50 lines
1.5 KiB
PHP
50 lines
1.5 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class Base extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('settings', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->timestamp('created_at')->useCurrent();
|
|
$table->json('value');
|
|
});
|
|
|
|
Schema::create('characters', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('name');
|
|
$table->softDeletes();
|
|
});
|
|
|
|
Schema::create('raids', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('name');
|
|
$table->softDeletes();
|
|
});
|
|
|
|
Schema::create('cards', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignId('character_id')->nullable()->constrained();
|
|
$table->foreignId('raid_id')->nullable()->constrained();
|
|
$table->enum('role', ['tank', 'healer', 'dps'])->nullable();
|
|
$table->enum('class', ['warrior', 'rogue', 'paladin', 'hunter', 'mage', 'warlock', 'shaman', 'druid', 'priest'])->nullable();
|
|
$table->string('body');
|
|
$table->softDeletes();
|
|
});
|
|
|
|
Schema::create('card_raids', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignId('raid_id')->constrained();
|
|
$table->foreignId('card_id')->constrained();
|
|
});
|
|
}
|
|
}
|