aboutsummaryrefslogtreecommitdiff
path: root/database/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'database/migrations')
-rw-r--r--database/migrations/2016_09_04_081754_create_verb_actions_table.php38
-rw-r--r--database/migrations/2016_09_04_081924_add_active_to_verbs.php31
2 files changed, 69 insertions, 0 deletions
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 @@
+<?php
+
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateVerbActionsTable extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::create('verb_actions', function (Blueprint $table) {
+ $table->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 @@
+<?php
+
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddActiveToVerbs extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::table('verbs', function (Blueprint $table) {
+ $table->boolean('active')->default(true);
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::table('verbs', function (Blueprint $table) {
+ $table->dropColumn('active');
+ });
+ }
+}