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 3ac031cfe59f3317ceee682b5d1ac64fd5808094..6ffb89210c22da8e528dd2b9a7415d5f051d7fb4 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 0a754dd35dd037dfff1ec2c52275f19b64cec4a3..3146c4dbecdefddc54ef20ffb1caba8e51a843bd 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'); }); }