You've already forked isop-mirror
refactor: restrict companies to only one contact
This commit is contained in:
@@ -16,6 +16,7 @@ return new class extends Migration
|
|||||||
$table->string("name")->nullable(false)->unique();
|
$table->string("name")->nullable(false)->unique();
|
||||||
$table->string("address")->nullable(false);
|
$table->string("address")->nullable(false);
|
||||||
$table->unsignedInteger("ico")->nullable(false)->unique();
|
$table->unsignedInteger("ico")->nullable(false)->unique();
|
||||||
|
$table->foreignId("contact")->nullable(false)->constrained("users")->onDelete("cascade");
|
||||||
$table->boolean("hiring")->nullable(false)->default(false);
|
$table->boolean("hiring")->nullable(false)->default(false);
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
return new class extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*/
|
|
||||||
public function up(): void
|
|
||||||
{
|
|
||||||
Schema::create('employers', function (Blueprint $table) {
|
|
||||||
$table->id();
|
|
||||||
$table->foreignId("user_id")->nullable(false)->constrained("users")->onDelete("cascade");
|
|
||||||
$table->foreignId("company_id")->nullable(false)->constrained("companies")->onDelete("cascade");
|
|
||||||
$table->timestamps();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('employers');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user