static function initDb() { // create the migration table if it does not exist $schema = SqlGetSchema(); if (!$schema->tableExists('migration')) { $sql = "create table migration (\n\t\t\t\t\t\tid serial primary key, \n\t\t\t\t\t\tname text not null,\n\t\t\t\t\t\tapplied int2 not null default 0)"; SqlAlterSchema($sql); } }
static function initDb($type) { if ($type != 'migration' && $type != 'seed') { trigger_error("invalid migration type: {$type}"); } // create the migration table if it does not exist $schema = SqlGetSchema(); if (!$schema->tableExists($type)) { $sql = "create table {$type} (\n\t\t\t\t\t\tid serial primary key, \n\t\t\t\t\t\tname text not null,\n\t\t\t\t\t\tapplied int2 not null default 0)"; SqlAlterSchema($sql, array()); } }