/apps/learn/migrations/00.00.01_words.php
http://zoop.googlecode.com/ · PHP · 27 lines · 25 code · 2 blank · 0 comment · 0 complexity · 26a20f0971a65d3250bf4a8beb945436 MD5 · raw file
- <?php
- class Migration_00_00_01 extends Migration
- {
- function up()
- {
- $sql = "create table word (
- id serial primary key,
- word text unique,
- len int2
- )";
- SqlAlterSchema($sql);
-
- $sql = "create table word_letter (
- id serial primary key,
- word_id int4 references word,
- letter \"char\",
- count int2
- )";
- SqlAlterSchema($sql);
- }
-
- function down()
- {
- SqlAlterSchema("drop table word_letter");
- SqlAlterSchema("drop table word");
- }
- }