mivita/database/migrations/2014_10_12_000000_create_users_table.php
Kevin Adametz bfa3bb1df4 08 2024
2024-08-05 12:05:24 +02:00

94 lines
2.8 KiB
PHP
Executable file

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('email')->unique();
$table->string('password');
$table->unsignedInteger('account_id')->nullable();
$table->unsignedInteger('m_level')->nullable();
$table->unsignedInteger('m_sponsor')->nullable();
$table->unsignedInteger('pre_sponsor')->nullable();
$table->boolean('confirmed')->default(false);
$table->string('confirmation_code', 30)->index()->nullable();
$table->timestamp('confirmation_date')->nullable();
$table->dateTime('confirmation_code_to')->nullable();
$table->unsignedTinyInteger('confirmation_code_remider')->default(0);
$table->timestamp('release_account')->nullable();
$table->boolean('active')->default(false);
$table->timestamp('active_date')->nullable();
$table->dateTime('agreement')->nullable();
$table->boolean('admin')->default(false);
$table->boolean('wizard')->default(false);
$table->boolean('blocked')->default(false);
$table->char('lang', 2)->index();
$table->text('notes')->nullable();
$table->rememberToken();
$table->timestamp('last_login')->nullable();
$table->unsignedInteger('payment_order_id')->nullable();
$table->timestamp('payment_account')->nullable();
$table->timestamp('payment_shop')->nullable();
$table->boolean('abo_options')->default(false);
$table->string('payment_methods')->nullable();
$table->boolean('test_mode')->default(false);
$table->text('settings')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreign('account_id')
->references('id')
->on('user_accounts');
$table->foreign('m_level')
->references('id')
->on('user_levels');
$table->foreign('m_sponsor')
->references('id')
->on('users');
$table->foreign('pre_sponsor')
->references('id')
->on('users');
$table->foreign('payment_order_id')
->references('id')
->on('products');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}