From b4958b4bf1fecbb2bace7dc9664b326841c8067e Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Sat, 12 Jan 2019 10:49:50 -0500 Subject: * Suggestions: show suggestions and track them --- .../2019_01_12_153012_create_suggested_table.php | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 laravel/database/migrations/2019_01_12_153012_create_suggested_table.php (limited to 'laravel/database/migrations') diff --git a/laravel/database/migrations/2019_01_12_153012_create_suggested_table.php b/laravel/database/migrations/2019_01_12_153012_create_suggested_table.php new file mode 100644 index 0000000..1f907ec --- /dev/null +++ b/laravel/database/migrations/2019_01_12_153012_create_suggested_table.php @@ -0,0 +1,37 @@ +increments('id'); + $table->unsignedInteger('from'); + $table->unsignedInteger('song'); + $table->unsignedInteger('clicks')->default(0); + $table->unsignedInteger('shown')->default(0); + $table->timestamps(); + $table->foreign('from')->references('id')->on('songs')->onDelete('cascade'); + $table->foreign('song')->references('id')->on('songs'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('suggestions'); + } +} -- cgit 1.4.1