예제 #1
0
파일: 11_status.php 프로젝트: rgigger/zinc
 function down()
 {
     $sql = "ALTER TABLE request DROP COLUMN status_id";
     SqlAlterSchema($sql);
     $sql = "DROP TABLE status";
     SqlAlterSchema($sql);
 }
예제 #2
0
파일: 3_priority.php 프로젝트: laiello/zoop
 function down()
 {
     $sql = "ALTER TABLE request DROP column priority_id";
     SqlAlterSchema($sql);
     $sql = "DROP TABLE priority";
     SqlAlterSchema($sql);
 }
예제 #3
0
 function up()
 {
     $sql = "create table person (\n\t\t\t\t\tid serial primary key, \n\t\t\t\t\tfirstname text,\n\t\t\t\t\tlastname text,\n\t\t\t\t\tusername text,\n\t\t\t\t\tpassword text\n\t\t\t\t)";
     SqlAlterSchema($sql);
     $sql = "create table project (\n\t\t\t\t\tid serial primary key, \n\t\t\t\t\tname text\n\t\t\t\t)";
     SqlAlterSchema($sql);
     $sql = "create table entry (\n\t\t\t\t\tid serial primary key, \n\t\t\t\t\tperson_id int4 references person,\n\t\t\t\t\tproject_id int4 references project,\n\t\t\t\t\tstarttime timestamp with time zone not null,\n\t\t\t\t\tendtime timestamp with time zone\n\t\t\t\t)";
     SqlAlterSchema($sql);
 }
예제 #4
0
파일: Migration.php 프로젝트: laiello/zoop
 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);
     }
 }
예제 #5
0
 function up()
 {
     $sql = "create table client\n\t\t\t\t(\n\t\t\t\t\tid serial primary key,\n\t\t\t\t\tname text\n\t\t\t\t)";
     SqlAlterSchema($sql);
     $sql = "create table invoice\n\t\t\t\t(\n\t\t\t\t\tid serial primary key,\n\t\t\t\t\tclient_id int4 references client\n\t\t\t\t)";
     SqlAlterSchema($sql);
     $sql = "create table invoice_item\n\t\t\t\t(\n\t\t\t\t\tid serial primary key,\n\t\t\t\t\tinvoice_id int4 references invoice\n\t\t\t\t)";
     SqlAlterSchema($sql);
 }
예제 #6
0
파일: Migration.php 프로젝트: rgigger/zinc
 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());
     }
 }
예제 #7
0
 function up()
 {
     $sql = "create table person (\n\t\t\t\t\tid serial primary key, \n\t\t\t\t\tfirstname text,\n\t\t\t\t\tlastname text\n\t\t\t\t)";
     SqlAlterSchema($sql);
     $sql = "create table exercise (\n\t\t\t\t\tid serial primary key, \n\t\t\t\t\tshort text,\n\t\t\t\t\tlong text\n\t\t\t\t)";
     SqlAlterSchema($sql);
     $sql = "create table session (\n\t\t\t\t\tid serial primary key, \n\t\t\t\t\tperson_id int4 references person(id),\n\t\t\t\t\tdate timestamp with time zone\n\t\t\t\t)";
     SqlAlterSchema($sql);
     $sql = "create table unit (\n\t\t\t\t\tid serial primary key, \n\t\t\t\t\tname text\n\t\t\t\t)";
     SqlAlterSchema($sql);
     $sql = "create table session_exercise (\n\t\t\t\t\tid serial primary key, \n\t\t\t\t\tsession_id int4 references session(id),\n\t\t\t\t\texercise_id int4 references exercise(id),\n\t\t\t\t\tunit_id int4 references unit(id),\n\t\t\t\t\tunit_count int4 not null default 0\n\t\t\t\t)";
     SqlAlterSchema($sql);
 }
예제 #8
0
 function down()
 {
     // $sql = "ALTER table request drop column html_desc";
     // SqlAlterSchema($sql);
     //
     // $sql = "ALTER table request drop column text_desc";
     // SqlAlterSchema($sql);
     //
     // $sql = "ALTER table request drop column description";
     // SqlAlterSchema($sql);
     //
     $sql = "ALTER table request drop column message_id";
     SqlAlterSchema($sql);
 }
예제 #9
0
파일: 1_person.php 프로젝트: rgigger/zinc
 function down()
 {
     $sql = "DROP TABLE <tablename>";
     SqlAlterSchema($sql, array());
 }
예제 #10
0
 function down()
 {
     SqlAlterSchema("drop table board_cell");
     SqlAlterSchema("drop table board");
 }
예제 #11
0
파일: 2_sessions.php 프로젝트: laiello/zoop
 function down()
 {
     SqlAlterSchema("DROP TABLE session_data");
     SqlAlterSchema("DROP TABLE session_base");
 }
예제 #12
0
 function down()
 {
     $sql = "DROP table attachment";
     SqlAlterSchema($sql);
 }
예제 #13
0
 function down()
 {
     SqlAlterSchema("drop index word_letter_word_id_idx");
 }
예제 #14
0
 function down()
 {
     $sql = "ALTER table request drop column short_desc";
     SqlAlterSchema($sql);
 }
예제 #15
0
파일: 4_filters.php 프로젝트: laiello/zoop
 function down()
 {
     $sql = "DROP TABLE filter";
     SqlAlterSchema($sql);
 }
예제 #16
0
파일: 1_start.php 프로젝트: laiello/zoop
 function down()
 {
     SqlAlterSchema("drop table request");
     SqlAlterSchema("drop table person");
 }
예제 #17
0
 function down()
 {
     $sql = "ALTER TABLE request RENAME COLUMN creator_id TO owner_id";
     $sql = "DROP table comment";
     SqlAlterSchema($sql);
 }
예제 #18
0
파일: 3_initForm.php 프로젝트: rgigger/zinc
 function up()
 {
     $sql = "CREATE TABLE session_form\n\t\t\t\t(\n\t\t\t\t    id serial primary key,\n\t\t\t\t    session_id text not null,\n\t\t\t\t    fields text not null\n\t\t\t\t)";
     SqlAlterSchema($sql);
 }
예제 #19
0
파일: 4_token.php 프로젝트: rgigger/zinc
 function down()
 {
     $sql = "DROP table token";
     SqlAlterSchema($sql);
 }
예제 #20
0
 function down()
 {
     SqlAlterSchema("drop table word_letter");
     SqlAlterSchema("drop table word");
 }