40 lines
1014 B
PHP
40 lines
1014 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreatePostsTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('posts', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string("title");
|
|
$table->text("text");
|
|
$table->timestamp("post_time");
|
|
$table->integer("time");
|
|
$table->timestamps();
|
|
$table->foreignId("time_period_id")->constrained('time_periods');
|
|
$table->foreignId("occupation_id")->constrained('occupations');
|
|
$table->foreignId("status_id")->constrained("statuses");
|
|
$table->foreignId("user_id")->constrained('users');
|
|
});
|
|
}
|
|
|
|
/**"
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('posts');
|
|
}
|
|
}
|