Skip to content

Commit c9f2e2b

Browse files
committed
improved
1 parent f51ae76 commit c9f2e2b

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
use Illuminate\Support\Facades\DB;
7+
8+
class DropUserLocationTable extends Migration
9+
{
10+
public function up()
11+
{
12+
Schema::dropIfExists('user_location');
13+
}
14+
15+
public function down()
16+
{
17+
Schema::create('user_location', function (Blueprint $table) {
18+
$table->increments('id');
19+
$table->string('user_id', 36);
20+
$table->foreign('user_id')->references('id')->on('user');
21+
$table->string('location_id', 36);
22+
$table->foreign('location_id')->references('id')->on('location');
23+
$table->double('personalized_rating', 11, 8);
24+
$table->datetime('when_submitted');
25+
$table->unique(array('location_id', 'user_id'));
26+
});
27+
}
28+
}

0 commit comments

Comments
 (0)