update marketing
All checks were successful
All checks were successful
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('vats', function (Blueprint $table) {
|
||||
$table->boolean('manage_state')->default(0)->after('sub_vat');
|
||||
});
|
||||
|
||||
Schema::create('vat_state_items', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('parent_vat_id')->constrained('vats')->cascadeOnDelete();
|
||||
$table->foreignId('child_vat_id')->constrained('vats')->cascadeOnDelete();
|
||||
$table->string('type')->comment('inner / outer');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('vat_state_items');
|
||||
Schema::table('vats', function (Blueprint $table) {
|
||||
$table->dropColumn('manage_state');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('vat_transactions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('business_id')->constrained()->onDelete('cascade');
|
||||
$table->foreignId('vat_id')->nullable()->constrained()->onDelete('set null');
|
||||
$table->decimal('vat_rate', 10, 2)->default(0);
|
||||
$table->decimal('vat_amount', 20, 2)->default(0);
|
||||
$table->unsignedBigInteger('vatable_id');
|
||||
$table->string('vatable_type');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['vatable_id', 'vatable_type']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('vat_transactions');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user