From 6f6a6abe3c9971b60aad585a198ced6c51329ef5 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Tue, 6 Sep 2016 00:23:26 +0200 Subject: Different root kinds instead of only strong/weak --- .../2016_09_05_215803_create_root_kinds.php | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 database/migrations/2016_09_05_215803_create_root_kinds.php (limited to 'database/migrations/2016_09_05_215803_create_root_kinds.php') diff --git a/database/migrations/2016_09_05_215803_create_root_kinds.php b/database/migrations/2016_09_05_215803_create_root_kinds.php new file mode 100644 index 0000000..2ab1a42 --- /dev/null +++ b/database/migrations/2016_09_05_215803_create_root_kinds.php @@ -0,0 +1,45 @@ +increments('id'); + $table->boolean('strong'); + $table->string('name')->unique(); + }); + + Schema::table('roots', function (Blueprint $table) { + $table->dropColumn('strong'); + + $table->integer('root_kind_id')->unsigned()->nullable(); + $table->foreign('root_kind_id')->references('id')->on('root_kinds'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('roots', function (Blueprint $table) { + $table->dropForeign(['root_kind_id']); + $table->dropColumn('root_kind_id'); + + $table->boolean('strong')->default(1); + }); + + Schema::drop('root_kinds'); + } +} -- cgit v1.2.3