doplnenie migracii

This commit is contained in:
dkecskes
2025-10-20 21:01:09 +02:00
parent 91c2c302ee
commit 6811fb43e5
2 changed files with 41 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void {
Schema::table('users', function (Blueprint $table) {
$table->string('phone')->nullable()->after('email');
$table->enum('role', ['STUDENT','EMPLOYER','ADMIN'])->default('STUDENT')->after('phone');
$table->boolean('is_active')->default(true)->after('role');
});
}
public function down(): void {
Schema::table('users', function (Blueprint $table) {
$table->dropColumn(['phone','role','is_active']);
});
}
};

View File

@@ -0,0 +1,21 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void {
Schema::create('companies', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('ICO', 20)->nullable()->unique();
$table->string('address');
$table->boolean('hiring')->default(false);
$table->timestamps();
});
}
public function down(): void {
Schema::dropIfExists('companies');
}
};