タグ登録機能の追加
This commit is contained in:
40
database/migrations/2018_01_08_075844_create_tags_table.php
Normal file
40
database/migrations/2018_01_08_075844_create_tags_table.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
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');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user