mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2025-03-31 00:07:46 +02:00
Ensure column does not exist before creation
This commit is contained in:
parent
abdfe2f698
commit
66ffd7714d
1 changed files with 30 additions and 28 deletions
|
@ -30,7 +30,8 @@ class AddDeletedAtColumnToActivities extends Migration
|
||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('activities', function(Blueprint $table) {
|
if (!Schema::hasColumn('activities', 'deleted_at')) {
|
||||||
|
Schema::table('activities', function (Blueprint $table) {
|
||||||
$table->softDeletes()->index();
|
$table->softDeletes()->index();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -63,6 +64,7 @@ class AddDeletedAtColumnToActivities extends Migration
|
||||||
->whereNotNull('comments.deleted_at')
|
->whereNotNull('comments.deleted_at')
|
||||||
->update(['deleted_at' => DB::raw('comments.deleted_at')]);
|
->update(['deleted_at' => DB::raw('comments.deleted_at')]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reverse the migrations.
|
* Reverse the migrations.
|
||||||
|
|
Loading…
Add table
Reference in a new issue