diff options
author | Camil Staps | 2016-09-05 23:43:35 +0200 |
---|---|---|
committer | Camil Staps | 2016-09-05 23:43:35 +0200 |
commit | 15b26b8b2af028ea30dc34f78ed5c6f3fcb0d547 (patch) | |
tree | e13decabbbe1f50553ea75cdeb50b5bc1496b9a8 /database | |
parent | Vote on verb suggestions (diff) |
Suggest new verbs
Diffstat (limited to 'database')
-rw-r--r-- | database/migrations/2016_09_04_081811_create_point_changes_table.php | 37 |
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'); + } +} |