App]
This commit is contained in:
36
_migrations/PostMigration.php
Normal file
36
_migrations/PostMigration.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace _migrations;
|
||||
|
||||
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');
|
||||
$table->text('content')->nullable(false);
|
||||
$table->integer('user_id');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function down(): void
|
||||
{
|
||||
Manager::schema()->dropIfExists('user');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user