tissue/database/migrations/2017_07_18_142028_create_ejaculations_table.php

41 lines
1022 B
PHP
Raw Normal View History

2017-08-27 04:44:53 +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;
2017-08-27 04:44:53 +09:00
class CreateEjaculationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ejaculations', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->timestamp('ejaculated_date');
$table->string('note', 500)->default('');
$table->double('geo_latitude')->nullable();
$table->double('geo_longitude')->nullable();
$table->boolean('is_private')->default(false);
$table->timestamps();
$table->index('user_id');
$table->unique(['user_id', 'ejaculated_date']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('ejaculations');
}
}