aboutsummaryrefslogtreecommitdiff
path: root/database/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'database/migrations')
-rw-r--r--database/migrations/2016_09_04_081811_create_point_changes_table.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/database/migrations/2016_09_04_081811_create_point_changes_table.php b/database/migrations/2016_09_04_081811_create_point_changes_table.php
new file mode 100644
index 0000000..4ade816
--- /dev/null
+++ b/database/migrations/2016_09_04_081811_create_point_changes_table.php
@@ -0,0 +1,37 @@
+<?php
+
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreatePointChangesTable extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::create('point_changes', function (Blueprint $table) {
+ $table->increments('id');
+ $table->integer('user_id')->unsigned();
+ $table->integer('verb_id')->unsigned()->nullable();
+ $table->tinyInteger('kind')->unsigned();
+ $table->integer('change');
+ $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('point_changes');
+ }
+}