Skip to content

Commit

Permalink
修复迁移错误
Browse files Browse the repository at this point in the history
  • Loading branch information
xutl committed Oct 17, 2017
1 parent ec18be8 commit 0609586
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions migrations/M161108091056Create_user_visit_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public function safeUp()
'created_at' => $this->integer()->unsigned()->notNull()->comment('Created At'),
], $tableOptions);
$this->createIndex('visit_source_id_user_id_index', '{{%visit}}', ['user_id', 'source_id']);
$this->addForeignKey('{{%visit_ibfk_1}}', '{{%user_visit}}', 'user_id', '{{%user}}', 'id', 'CASCADE', 'RESTRICT');
$this->addForeignKey('{{%visit_ibfk_2}}', '{{%user_visit}}', 'source_id', '{{%user}}', 'id', 'CASCADE', 'RESTRICT');
$this->addForeignKey('{{%visit_fk_1}}', '{{%visit}}', 'user_id', '{{%user}}', 'id', 'CASCADE', 'RESTRICT');
$this->addForeignKey('{{%visit_fk_2}}', '{{%visit}}', 'source_id', '{{%user}}', 'id', 'CASCADE', 'RESTRICT');
}

public function safeDown()
Expand Down

0 comments on commit 0609586

Please sign in to comment.