PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1<?php
 2class Migration_00_00_01 extends Migration
 3{
 4	function up()
 5	{
 6		$sql = "create table word (
 7					id serial primary key, 
 8					word text unique,
 9					len int2
10				)";
11		SqlAlterSchema($sql);
12		
13		$sql = "create table word_letter (
14					id serial primary key, 
15					word_id int4 references word,
16					letter \"char\",
17					count int2
18				)";
19		SqlAlterSchema($sql);	
20	}
21	
22	function down()
23	{
24		SqlAlterSchema("drop table word_letter");
25		SqlAlterSchema("drop table word");
26	}
27}