| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- use App\Database\Migrations\TenantMigration;
- return new class extends TenantMigration
- {
- /**
- * Run the migrations.
- */
- public function up(): void
- {
- Schema::create('resource_rates', function (Blueprint $table) {
- $table->id();
- $table->unsignedBigInteger('resource_id')->nullable();
- $table->foreign('resource_id')->nullable()->references('id')->on('resources')->onUpdate('cascade')->onDelete('cascade');
- $table->unsignedBigInteger('rate_group_id')->nullable();
- $table->foreign('rate_group_id')->nullable()->references('id')->on('rate_groups')->onUpdate('cascade')->onDelete('cascade');
- $table->unsignedBigInteger('rate_type_id')->nullable();
- $table->foreign('rate_type_id')->nullable()->references('id')->on('rate_types')->onUpdate('cascade')->onDelete('cascade');
- $table->unsignedBigInteger('company_rate_id')->nullable();
- $table->foreign('company_rate_id')->nullable()->references('id')->on('company_rates')->onUpdate('cascade')->onDelete('cascade');
- $table->decimal('cost', total: 8, places: 2);
- $table->decimal('price', total: 8, places: 2);
- $table->boolean('enabled')->default(1);
- $table->softDeletes();
- $table->timestamps();
- });
- }
- /**
- * Reverse the migrations.
- */
- public function down(): void
- {
- Schema::dropIfExists('resource_rates');
- }
- };
|