36 lines
807 B
PHP
36 lines
807 B
PHP
|
<?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('rooms', function (Blueprint $table) {
|
||
|
$table->id('room_id');
|
||
|
$table->timestamps();
|
||
|
$table->addColumn('string', 'room_name', ['length' => 255]);
|
||
|
$table->addColumn('integer', 'room_rows');
|
||
|
$table->addColumn('integer', 'room_columns');
|
||
|
$table->unique(['room_name']);
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
Schema::dropIfExists('rooms');
|
||
|
}
|
||
|
};
|