mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
Fix a potential migration bug
This commit is contained in:
parent
3e3004a904
commit
6f9a057879
1 changed files with 4 additions and 0 deletions
|
@ -13,7 +13,9 @@ class RenameContributingArtistId extends Migration
|
|||
public function up()
|
||||
{
|
||||
Schema::table('songs', function ($table) {
|
||||
$table->dropForeign(['contributing_artist_id']);
|
||||
$table->renameColumn('contributing_artist_id', 'artist_id');
|
||||
$table->foreign('artist_id')->references('id')->on('artists')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -25,7 +27,9 @@ class RenameContributingArtistId extends Migration
|
|||
public function down()
|
||||
{
|
||||
Schema::table('songs', function ($table) {
|
||||
$table->dropForeign(['contributing_artist_id']);
|
||||
$table->renameColumn('artist_id', 'contributing_artist_id');
|
||||
$table->foreign('artist_id')->references('id')->on('artists')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue