root/trunk/data/migrations/005_m1.php

Revision 68, 1.0 kB (checked in by nperriault, 6 months ago)

[1.1] everything is broken \o/

Line 
1 <?php
2 class Migration005 extends sfMigration
3 {
4
5   public function up()
6   {
7     $this->executeSQL("ALTER TABLE `tag`
8       ADD `is_triple` INT( 11 ) NULL ,
9       ADD `triple_namespace` VARCHAR( 100 ) NULL ,
10       ADD `triple_key` VARCHAR( 100 ) NULL ,
11       ADD `triple_value` VARCHAR( 100 ) NULL ;");
12     $this->executeSQL("ALTER TABLE `tag` ADD INDEX ( `triple_namespace` , `triple_key` , `triple_value` );");
13     $this->executeSQL("ALTER TABLE `tagging` CHANGE `tag_id` `tag_id` INT( 11 ) NOT NULL");
14     $this->executeSQL("RENAME TABLE symfonians.tag  TO symfonians.sf_tag;");
15     $this->executeSQL("RENAME TABLE symfonians.tagging  TO symfonians.sf_tagging;");
16   }
17
18   public function down()
19   {
20     $this->executeSQL("ALTER TABLE `sf_tag`
21       DROP `is_triple`,
22       DROP `triple_namespace`,
23       DROP `triple_key`,
24       DROP `triple_value`;");
25     $this->executeSQL("RENAME TABLE symfonians.sf_tag  TO symfonians.tag;");
26     $this->executeSQL("RENAME TABLE symfonians.sf_tagging  TO symfonians.tagging;");
27   }
28
29 }
30
Note: See TracBrowser for help on using the browser.