/apps/learn/migrations/00.00.03_board.php
PHP | 26 lines | 23 code | 3 blank | 0 comment | 0 complexity | 3d39df1d9555cbb97777c8177e9106cc MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.1
- <?php
- class Migration_00_00_03 extends Migration
- {
- function up()
- {
- $sql = "create table board (id serial primary key, name text unique)";
- SqlAlterSchema($sql);
- SqlInsertRow("insert into board (name) values (:name)", array('name' => 'default'));
-
- $sql = "create table board_cell (
- id serial primary key,
- board_id int4 references board,
- row_num int2 not null,
- col_num int2 not null,
- letter varchar(1) not null
- )";
- SqlAlterSchema($sql);
-
- }
-
- function down()
- {
- SqlAlterSchema("drop table board_cell");
- SqlAlterSchema("drop table board");
- }
- }