mirror of
https://github.com/koel/koel
synced 2024-11-24 13:13:05 +00:00
Make sure modified artists cascade the album's artist_id field
This commit is contained in:
parent
b7952c0213
commit
e2d35738fd
1 changed files with 6 additions and 0 deletions
|
@ -12,6 +12,12 @@ class CreateVariousArtists extends Migration
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
// Make sure modified artists cascade the album's artist_id field.
|
||||
Schema::table('albums', function ($table) {
|
||||
$table->dropForeign('albums_artist_id_foreign');
|
||||
$table->foreign('artist_id')->references('id')->on('artists')->onUpdate('cascade')->onDelete('cascade');
|
||||
});
|
||||
|
||||
Artist::unguard();
|
||||
|
||||
$existingArtist = Artist::find(Artist::VARIOUS_ID);
|
||||
|
|
Loading…
Reference in a new issue