Initial Commit; base feats

This commit is contained in:
Didier Slof 2022-11-23 09:32:34 +01:00
commit 9732135e90
Signed by: didier
GPG key ID: 01E71F18AA4398E5
137 changed files with 13856 additions and 0 deletions

View file

@ -0,0 +1,37 @@
<?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('tickets', function (Blueprint $table) {
$table->id('ticket_id');
$table->timestamps();
$table->foreignId('order_id')->constrained('orders', 'order_id');
$table->foreignId('showing_id')->constrained('showings', 'showing_id');
$table->foreignId('seat_id')->constrained('seats', 'seat_id');
$table->foreignId('price_id')->constrained('prices', 'price_id');
$table->foreignId('user_id')->constrained('users', 'user_id');
$table->unique(['order_id', 'showing_id', 'seat_id']); // only one ticket per seat per showing per order
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('tickets');
}
};