This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

MySQL migration fix for #175

  • Loading branch information...
charlesportwoodii committed Jul 31, 2017
1 parent 8456922 commit f52930578ae62853d09f9dc34a384fe0da05a51b
@@ -83,7 +83,7 @@ private function createUserTables()
$this->addPrimaryKey('user_metadata_composite', 'user_metadata', 'user_id,key');
// Setup the foreign key constraints
$this->addForeignKey('user_roles_relation_fk', 'user_metadata', 'user_id', 'users', 'id', 'CASCADE', 'NO ACTION');
$this->addForeignKey('user_metadata_relation_fk', 'user_metadata', 'user_id', 'users', 'id', 'CASCADE', 'NO ACTION');
// Insert data into the tables
$this->insert('user_roles', array(
@@ -0,0 +1,25 @@
<?php
class m170731_173719_comments_and_relationships_fix extends CDbMigration
{
public function up()
{
}
public function down()
{
$this->addForeignKey('user_roles_fk', 'users', 'user_role', 'user_roles', 'id', 'CASCADE', 'NO ACTION');
$this->execute('ALTER TABLE `comments` MODIFY comment TEXT NOT NULL');
}
/*
// Use safeUp/safeDown to do migration with transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}

0 comments on commit f529305

Please sign in to comment.