MicroFrameWork/_migrations/UserMigration.php
2024-07-29 15:57:20 +03:00

37 lines
895 B
PHP

<?php
namespace _migrations;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Capsule\Manager;
class UserMigration extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public static function up(): void
{
Manager::schema()->create('user', function (Blueprint $table) {
$table->increments('id');
$table->string('username', 255)->nullable(false);
$table->string('email', 255);
$table->string('password_hash', 255);
$table->integer('role')->default(1);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public static function down(): void
{
Manager::schema()->dropIfExists('user');
}
}