Archived
1
0
Fork 0
This repository has been archived on 2026-06-16. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
wow-raid-bingo/database/migrations/2021_09_13_000000_base.php
2021-10-18 11:56:52 +02:00

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();
});
}
}