igfs/_migrations/PostMigration.php

36 lines
787 B
PHP
Raw Permalink Normal View History

2024-07-10 14:39:37 +03:00
<?php
2024-07-29 15:57:20 +03:00
namespace _migrations;
2024-07-10 14:39:37 +03:00
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Capsule\Manager;
class PostMigration extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public static function up(): void
{
Manager::schema()->create('post', function (Blueprint $table) {
$table->increments('id');
2024-07-26 16:09:06 +03:00
$table->text('content')->nullable(false);
2024-07-26 11:57:05 +03:00
$table->integer('user_id');
2024-07-10 14:39:37 +03:00
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public static function down(): void
{
Manager::schema()->dropIfExists('user');
}
}