topnotch_website/database/migrations/008_create_orders_table.php

47 lines
1.4 KiB
PHP
Raw Normal View History

2024-09-03 15:15:57 -07:00
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
2024-09-09 15:29:31 -07:00
return new class extends Migration
{
2024-09-03 15:15:57 -07:00
public function up(): void
{
Schema::create('orders', function (Blueprint $table) {
$table->id();
2024-11-05 11:35:23 -05:00
2024-09-09 15:29:31 -07:00
$table->foreignId('customer_id')->constrained();
$table->foreignId('contact_id')->nullable()->constrained();
2024-11-05 11:35:23 -05:00
$table->foreignId('invoice_id')->nullable()->constrained();
2024-09-09 15:29:31 -07:00
$table->string('internal_po')->nullable();
2024-09-03 15:15:57 -07:00
$table->string('customer_po');
2024-09-09 15:29:31 -07:00
$table->string('order_type');
2024-09-03 15:15:57 -07:00
$table->date('order_date');
$table->date('due_date');
2024-09-09 15:29:31 -07:00
$table->string('status');
$table->longText('notes')->nullable();
2024-10-22 12:48:05 -04:00
$table->boolean('rush')->default(0);
$table->boolean('repeat')->default(0);
$table->boolean('new_art')->default(0);
$table->boolean('event')->default(0);
$table->boolean('digitizing')->default(0);
$table->boolean('garments')->default(0);
$table->boolean('supplied_file')->default(0);
$table->boolean('printed')->default(0);
$table->boolean('pre_production')->default(0);
2024-09-03 15:15:57 -07:00
$table->softDeletes();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('orders');
}
};