| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- return new class extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('members', function (Blueprint $table) {
- $table->id();
- $table->string('first_name');
- $table->string('last_name');
- $table->string('status');
- $table->unsignedBigInteger('birth_city_id')->nullable();
- $table->foreign('birth_city_id')->nullable()->references('id')->on('cities')->onUpdate('cascade')->onDelete('cascade');
- $table->unsignedBigInteger('birth_province_id')->nullable();
- $table->foreign('birth_province_id')->nullable()->references('id')->on('provinces')->onUpdate('cascade')->onDelete('cascade');
- $table->unsignedBigInteger('birth_nation_id')->nullable();
- $table->foreign('birth_nation_id')->nullable()->references('id')->on('nations')->onUpdate('cascade')->onDelete('cascade');
- $table->date('birth_date')->nullable();
- $table->string('gender', 1)->nullable();
- $table->string('fiscal_code', 16)->nullable();
- $table->string('address')->nullable();
- $table->string('zip_code', 5)->nullable();
- $table->unsignedBigInteger('nation_id')->nullable();
- $table->foreign('nation_id')->nullable()->references('id')->on('nations')->onUpdate('cascade')->onDelete('cascade');
- $table->unsignedBigInteger('province_id')->nullable();
- $table->foreign('province_id')->nullable()->references('id')->on('provinces')->onUpdate('cascade')->onDelete('cascade');
- $table->unsignedBigInteger('city_id')->nullable();
- $table->foreign('city_id')->nullable()->references('id')->on('cities')->onUpdate('cascade')->onDelete('cascade');
- $table->string('phone')->nullable();
- $table->string('email')->nullable();
- $table->integer('enabled')->default(1);
- $table->softDeletes();
- $table->timestamps();
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('members');
- }
- };
|