You've already forked isop-mirror
doplnenie migracii
This commit is contained in:
@@ -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']);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user