Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Commit

Permalink
Seed problems fixed
Browse files Browse the repository at this point in the history
Was a problem with seeding data since indexes didn't match from develop and production. Also fixed a seed error with roles.
  • Loading branch information
HeppyEkberg committed May 24, 2017
1 parent 2f9e2d8 commit 92eb779
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
42 changes: 42 additions & 0 deletions database/migrations/2017_05_24_161645_edit_sets_table_index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class EditSetsTableIndex extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('sets', function (Blueprint $table) {
$table->dropUnique('sets_external_id_unique');
});

Schema::table('sets', function (Blueprint $table) {
$table->unique(['external_id', 'lang'], 'external_id_lang_unique');
$table->unique(['slug', 'lang'], 'slug_unique');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('sets', function (Blueprint $table) {
$table->dropUnique('external_id_lang_unique');
$table->dropUnique('slug_unique');
});

Schema::table('sets', function (Blueprint $table) {
$table->unique('external_id', 'sets_external_id_unique');
});
}
}
2 changes: 1 addition & 1 deletion database/seeds/Initial/RoleSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function run()
$user = \App\User::find(1);

$user->roles()->attach(1);
$user->roles()->attach(3);
$user->roles()->attach(2);

}
}

0 comments on commit 92eb779

Please sign in to comment.