From 3402c0950e339de353ab3c5280444384575f30f5 Mon Sep 17 00:00:00 2001 From: Kurniandha Sukma Yunastrian <13516106@std.stei.itb.ac.id> Date: Sun, 5 Apr 2020 15:35:29 +0700 Subject: [PATCH] edit migration --- .../migrations/2020_03_11_190629_create_topics_table.php | 1 + .../2020_03_11_190641_create_spreadsheets_table.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/database/migrations/2020_03_11_190629_create_topics_table.php b/database/migrations/2020_03_11_190629_create_topics_table.php index 3ac031c..6ffb892 100644 --- a/database/migrations/2020_03_11_190629_create_topics_table.php +++ b/database/migrations/2020_03_11_190629_create_topics_table.php @@ -18,6 +18,7 @@ class CreateTopicsTable extends Migration $table->bigInteger('id_course')->unsigned(); $table->string('name'); $table->string('content'); + $table->string('id_spreadsheet'); $table->foreign('id_course')->references('id')->on('courses'); }); diff --git a/database/migrations/2020_03_11_190641_create_spreadsheets_table.php b/database/migrations/2020_03_11_190641_create_spreadsheets_table.php index 0a754dd..3146c4d 100644 --- a/database/migrations/2020_03_11_190641_create_spreadsheets_table.php +++ b/database/migrations/2020_03_11_190641_create_spreadsheets_table.php @@ -14,13 +14,13 @@ class CreateSpreadsheetsTable extends Migration public function up() { Schema::create('spreadsheets', function (Blueprint $table) { - $table->bigInteger('id_topic')->unsigned(); + $table->string('id'); $table->string('cell'); $table->string('value'); $table->string('type'); - $table->primary(['id_topic', 'cell']); - $table->foreign('id_topic')->references('id')->on('topics'); + $table->primary(['id', 'cell']); + $table->foreign('id')->references('id_spreadsheet')->on('topics'); }); } -- GitLab