Skip to content

Commit

Permalink
Tiny changes for clean migrations
Browse files Browse the repository at this point in the history
I suggest tiny changes in order to keep clean migrations and table (with the `created_at` and `updated_at` fields as last fields).
  • Loading branch information
Okipa authored Nov 4, 2019
1 parent 6565cbb commit 0dba2fc
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class ExtendMetaTable extends Migration
public function up()
{
Schema::table('meta', function (Blueprint $table) {
$table->unsignedBigInteger('metable_id')->default(0);
$table->string('metable_type')->default('');
$table->unsignedBigInteger('metable_id')->default(0)->after('type');
$table->string('metable_type')->default('')->after('metable_id');

$table->unique(['realm', 'metable_type', 'metable_id', 'key']);

Expand All @@ -38,7 +38,7 @@ public function down()
$table->dropUnique(['realm', 'metable_type', 'metable_id', 'key']);

// Return previous (vkovic/laravel-meta) unique
$table->dropUnique(['realm', 'key']);
$table->unique(['realm', 'key']);
});
}
}
}

0 comments on commit 0dba2fc

Please sign in to comment.