From fc5cef0efddbb1141b0a371108a23fc7f6e8d860 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 5 Sep 2016 22:30:47 +0200 Subject: Vote on verb suggestions --- ...2016_09_04_081754_create_verb_actions_table.php | 38 ++++++++++++++++++++++ .../2016_09_04_081924_add_active_to_verbs.php | 31 ++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 database/migrations/2016_09_04_081754_create_verb_actions_table.php create mode 100644 database/migrations/2016_09_04_081924_add_active_to_verbs.php (limited to 'database/migrations') diff --git a/database/migrations/2016_09_04_081754_create_verb_actions_table.php b/database/migrations/2016_09_04_081754_create_verb_actions_table.php new file mode 100644 index 0000000..d7b0f29 --- /dev/null +++ b/database/migrations/2016_09_04_081754_create_verb_actions_table.php @@ -0,0 +1,38 @@ +increments('id'); + $table->integer('user_id')->unsigned(); + $table->integer('verb_id')->unsigned(); + $table->tinyInteger('kind'); + $table->tinyInteger('vote_weight')->nullable(); + $table->string('comment_text')->nullable(); + $table->timestamp('date')->default(DB::raw('CURRENT_TIMESTAMP')); + + $table->foreign('user_id')->references('id')->on('users'); + $table->foreign('verb_id')->references('id')->on('verbs'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('verb_actions'); + } +} diff --git a/database/migrations/2016_09_04_081924_add_active_to_verbs.php b/database/migrations/2016_09_04_081924_add_active_to_verbs.php new file mode 100644 index 0000000..79c5993 --- /dev/null +++ b/database/migrations/2016_09_04_081924_add_active_to_verbs.php @@ -0,0 +1,31 @@ +boolean('active')->default(true); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('verbs', function (Blueprint $table) { + $table->dropColumn('active'); + }); + } +} -- cgit v1.2.3