2018-01-08 08:50:22 +09:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
2019-01-15 00:05:01 +09:00
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
2018-01-08 08:50:22 +09:00
|
|
|
|
|
|
|
class CreateTagsTable extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('tags', function (Blueprint $table) {
|
|
|
|
$table->increments('id');
|
|
|
|
$table->string('name');
|
|
|
|
$table->timestamps();
|
|
|
|
});
|
|
|
|
|
|
|
|
Schema::create('ejaculation_tag', function (Blueprint $table) {
|
|
|
|
$table->increments('id');
|
|
|
|
$table->integer('ejaculation_id')->index();
|
|
|
|
$table->integer('tag_id')->index();
|
|
|
|
$table->timestamps();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::dropIfExists('tags');
|
|
|
|
Schema::dropIfExists('ejaculation_tag');
|
|
|
|
}
|
|
|
|
}
|