Skip to content

Commit

Permalink
recreate migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
devfake committed Feb 26, 2016
1 parent 065e5b9 commit 22ac0c2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ public function up()
$table->index('title');
$table->string('slug');
$table->string('poster');
$table->integer('category_id')->nullable();
//$table->integer('category_id')->unsigned();
//$table->foreign('category_id')->references('id')->on('categories');
$table->integer('category_id')->unsigned();
$table->foreign('category_id')->references('id')->on('categories');
$table->string('rating');
$table->integer('released');
$table->integer('seen');
Expand Down
7 changes: 6 additions & 1 deletion backend/database/seeds/CategoryTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ class CategoryTableSeeder extends Seeder
*/
public function run()
{
DB::table('categories')->insert([
DB::table('categories')->insert([
'name' => 'No Category',
'slug' => 'all'
]);

DB::table('categories')->insert([
'name' => 'Horror',
'slug' => 'horror'
]);
Expand Down
8 changes: 4 additions & 4 deletions backend/database/seeds/ItemTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function run()
'title' => 'Jurassic World',
'slug' => Str::slug('Jurassic World'),
'poster' => '/uXZYawqUsChGSj54wcuBtEdUJbh.jpg',
'category_id' => null,
'category_id' => 1,
'rating' => 4.5,
'released' => '1429912800',
'seen' => '1429912800',
Expand All @@ -53,7 +53,7 @@ public function run()
'title' => 'The Babadook',
'slug' => Str::slug('The Babadook'),
'poster' => '/b3YzM03YxkOaJw2PglfKlcwr8bM.jpg',
'category_id' => null,
'category_id' => 1,
'rating' => 4,
'released' => '1429912800',
'seen' => '1429912800',
Expand Down Expand Up @@ -127,7 +127,7 @@ public function run()
'title' => 'Vikings',
'slug' => Str::slug('Vikings'),
'poster' => '/mBDlsOhNOV1MkNii81aT14EYQ4S.jpg',
'category_id' => null,
'category_id' => 1,
'rating' => 5,
'released' => '1429912800',
'seen' => '1429912800',
Expand Down Expand Up @@ -199,7 +199,7 @@ public function run()
'title' => 'Hunter x Hunter',
'slug' => Str::slug('Hunter x Hunter'),
'poster' => '/l5CLmiz0yPwusw3D10XaQDuSFTm.jpg',
'category_id' => null,
'category_id' => 1,
'rating' => 5,
'released' => '1429912800',
'seen' => '1429912800',
Expand Down

0 comments on commit 22ac0c2

Please sign in to comment.