Files
roxane/database/migrations/2025_10_20_111419_create_members_table.php

79 lines
2.1 KiB
PHP
Raw Normal View History

2025-10-22 17:09:48 +02:00
<?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
{
// MEMBERS
Schema::create('members', function (Blueprint $table) {
$table->id();
// User
$table->foreignId('user_id')->nullable()->constrained('users')->onDelete('set null');
2025-11-15 17:09:56 +01:00
$table->string('dolibarr_id')->nullable();
2025-10-22 17:09:48 +02:00
// Keycloak
$table->string('keycloak_id')->nullable();
// Statuses
$table->enum('status', [
'draft',
'valid',
'pending',
'cancelled',
'excluded'
])->default('draft');
// Nature
$table->enum('nature', ['physical', 'legal'])->default('physical');
2025-11-15 17:09:56 +01:00
// Type
$table->unsignedBigInteger('type_id')->nullable();
2025-10-22 17:09:48 +02:00
// Group
$table->unsignedBigInteger('group_id')->nullable();
// Identity
$table->string('lastname')->nullable();
$table->string('firstname')->nullable();
$table->string('email');
2025-11-15 17:09:56 +01:00
$table->string('retzien_email')->nullable();
2025-10-22 17:09:48 +02:00
$table->string('company')->nullable();
$table->date('date_of_birth')->nullable();
// Coordinates
$table->string('address')->nullable();
$table->string('zipcode')->nullable();
$table->string('city')->nullable();
$table->string('country')->nullable();
$table->string('phone1')->nullable();
$table->string('phone2')->nullable();
// Membership type
$table->boolean('public_membership')->default(false);
2025-11-15 17:09:56 +01:00
// Others
$table->string('website_url')->nullable();
2025-10-22 17:09:48 +02:00
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('members');
}
};