Skip to content

Commit 0f3b296

Browse files
committed
Hot fix: fixed bugs with migrations
1 parent 82e4c37 commit 0f3b296

2 files changed

+5
-3
lines changed

database/migrations/2015_10_09_153005_create_global_flag_for_role_table.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ public function up()
2727
public function down()
2828
{
2929
Schema::table('roles', function (Blueprint $table) {
30-
//DB::table('roles')->whereNotNull('is_global')->delete();
31-
DB::table('roles')->delete();
30+
DB::table('roles')->whereNotNull('is_global')->delete();
31+
3232
$table->dropUnique('roles_title_is_global_unique');
3333
$table->dropColumn('is_global');
3434
$table->unique('title');

database/migrations/2015_10_12_064907_rename_is_global_column_in_roles_table.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ public function up()
3131
public function down()
3232
{
3333
Schema::table('roles', function (Blueprint $table) {
34+
DB::table('roles')->whereNotNull('local_id')->delete();
35+
3436
$table->dropUnique('roles_title_local_id_unique');
3537
$table->dropForeign('roles_local_id_foreign');
3638
$table->dropColumn('local_id');
3739

3840
$table->boolean('is_global')->nullable();
39-
//$table->unique(array('title', 'is_global'));
41+
$table->unique(array('title', 'is_global'));
4042
});
4143
}
4244
}

0 commit comments

Comments
 (0)