2020-04-12 00:26:44 +02:00
|
|
|
<?php
|
|
|
|
|
2022-11-07 16:18:11 +01:00
|
|
|
use App\Letter\BillKind;
|
2021-11-18 00:34:53 +01:00
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
2020-04-12 00:26:44 +02:00
|
|
|
|
|
|
|
class CreateMembersTable extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
2021-04-11 18:17:40 +02:00
|
|
|
Schema::create('bill_kinds', function (Blueprint $table) {
|
|
|
|
$table->id();
|
|
|
|
$table->string('name');
|
|
|
|
});
|
|
|
|
|
|
|
|
BillKind::create(['name' => 'E-Mail']);
|
|
|
|
BillKind::create(['name' => 'Post']);
|
|
|
|
|
2020-04-12 00:26:44 +02:00
|
|
|
Schema::create('members', function (Blueprint $table) {
|
2021-04-10 03:08:34 +02:00
|
|
|
$table->id();
|
2020-06-01 22:22:19 +02:00
|
|
|
$table->string('firstname');
|
|
|
|
$table->string('lastname');
|
|
|
|
$table->string('nickname')->nullable();
|
2021-04-10 03:08:34 +02:00
|
|
|
$table->foreignId('gender_id')->nullable()->constrained();
|
2021-11-18 00:34:53 +01:00
|
|
|
$table->foreignId('country_id')->nullable()->constrained();
|
2020-06-01 22:22:19 +02:00
|
|
|
$table->string('other_country')->nullable();
|
2021-04-10 03:08:34 +02:00
|
|
|
$table->foreignId('confession_id')->nullable()->constrained();
|
2020-06-01 22:22:19 +02:00
|
|
|
$table->date('birthday');
|
|
|
|
$table->date('joined_at');
|
2021-04-10 02:11:13 +02:00
|
|
|
$table->boolean('send_newspaper');
|
2020-06-01 22:22:19 +02:00
|
|
|
$table->string('address');
|
|
|
|
$table->string('further_address')->nullable();
|
|
|
|
$table->string('zip');
|
2021-04-10 01:39:39 +02:00
|
|
|
$table->string('location');
|
2021-06-13 11:32:56 +02:00
|
|
|
$table->foreignId('group_id')->constrained();
|
2021-04-10 03:08:34 +02:00
|
|
|
$table->foreignId('region_id')->nullable()->constrained();
|
2021-04-10 01:39:39 +02:00
|
|
|
$table->string('main_phone')->nullable();
|
|
|
|
$table->string('mobile_phone')->nullable();
|
|
|
|
$table->string('work_phone')->nullable();
|
2020-06-01 22:22:19 +02:00
|
|
|
$table->string('fax')->nullable();
|
|
|
|
$table->string('email')->nullable();
|
|
|
|
$table->string('email_parents')->nullable();
|
|
|
|
$table->integer('nami_id')->nullable();
|
2021-04-10 03:08:34 +02:00
|
|
|
$table->foreignId('nationality_id')->constrained();
|
2021-04-11 17:37:26 +02:00
|
|
|
$table->text('letter_address')->nullable();
|
2021-04-11 18:17:40 +02:00
|
|
|
$table->foreignId('bill_kind_id')->nullable()->constrained();
|
2021-06-23 01:05:17 +02:00
|
|
|
$table->foreignId('first_activity_id')->nullable()->constrained('activities');
|
|
|
|
$table->foreignId('first_subactivity_id')->nullable()->constrained('subactivities');
|
2021-06-21 23:50:09 +02:00
|
|
|
$table->unsignedInteger('version')->default(1);
|
2022-02-12 01:06:44 +01:00
|
|
|
$table->datetime('confirmed_at')->nullable();
|
|
|
|
$table->string('children_phone')->nullable();
|
|
|
|
$table->foreignId('subscription_id')->nullable()->default(1)->constrained();
|
2021-11-18 00:38:50 +01:00
|
|
|
|
2020-04-12 00:26:44 +02:00
|
|
|
$table->timestamps();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::dropIfExists('members');
|
2021-04-11 18:17:40 +02:00
|
|
|
Schema::dropIfExists('bill_kinds');
|
2020-04-12 00:26:44 +02:00
|
|
|
}
|
|
|
|
}
|