mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-25 06:27:59 +01: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()
|
||||
{
|
||||
Schema::table('activities', function(Blueprint $table) {
|
||||
if (!Schema::hasColumn('activities', 'deleted_at')) {
|
||||
Schema::table('activities', function (Blueprint $table) {
|
||||
$table->softDeletes()->index();
|
||||
});
|
||||
|
||||
|
@ -63,6 +64,7 @@ class AddDeletedAtColumnToActivities extends Migration
|
|||
->whereNotNull('comments.deleted_at')
|
||||
->update(['deleted_at' => DB::raw('comments.deleted_at')]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
|
|
Loading…
Reference in a new issue