-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added soft deleting to Backend User Groups (#972)
Fixes #386. Related: wintercms/storm#156 PR
- Loading branch information
1 parent
21ef686
commit be4c607
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
database/migrations/2023_09_09_000013_Db_Backend_Add_Users_Groups_Delete_At.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
use Winter\Storm\Database\Schema\Blueprint; | ||
use Winter\Storm\Database\Updates\Migration; | ||
|
||
class DbBackendAddUsersGroupsDeleteAt extends Migration | ||
{ | ||
public function up() | ||
{ | ||
if (!Schema::hasColumn('backend_users_groups', 'deleted_at')) { | ||
Schema::table('backend_users_groups', function (Blueprint $table) { | ||
$table->timestamp('deleted_at')->nullable()->after('user_group_id'); | ||
}); | ||
} | ||
} | ||
|
||
public function down() | ||
{ | ||
if (Schema::hasColumn('backend_users_groups', 'deleted_at')) { | ||
Schema::table('backend_users_groups', function (Blueprint $table) { | ||
$table->dropColumn('deleted_at'); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters