Created
August 13, 2013 08:40
-
-
Save stuartbates/6219110 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class m130726_082858_yii_category_point extends CDbMigration | |
{ | |
public function up() | |
{ | |
$this->createTable('yii_category_point', array( | |
'category_id'=>'int NOT NULL', | |
'point_id'=>'int NOT NULL', | |
'PRIMARY KEY (`category_id`, `point_id`)' | |
)); | |
$this->addForeignKey('fk_category_point_point_id', 'yii_category_point', 'category_id', 'yii_category', 'id' ); | |
$this->addForeignKey('fk_category_point_category_id', 'yii_category_point', 'point_id', 'yii_point', 'id' ); | |
} | |
public function down() | |
{ | |
$this->dropTable('yii_category_point'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment