feat: updates
This commit is contained in:
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -30,10 +31,9 @@ return new class () extends Migration {
|
||||
$table->decimal('payable_withholding_tax')->nullable();
|
||||
$table->decimal('creditable_withholding_tax')->nullable();
|
||||
|
||||
$table->foreignId('expense_id')->nullable()->constrained()->onDelete('cascade');
|
||||
$table->foreignId('sale_id')->nullable()->constrained()->onDelete('cascade');
|
||||
$table->morphs('transactionable');
|
||||
|
||||
$table->foreignId('branch_id')->constrained()->onDelete('cascade');
|
||||
$table->foreignId('client_id')->constrained()->onDelete('cascade');
|
||||
$table->date('happened_on');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -12,7 +13,7 @@ return new class () extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('transmittal', function (Blueprint $table) {
|
||||
Schema::create('transmittals', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('series');
|
||||
$table->foreignId('client_id')->constrained();
|
||||
|
||||
@@ -14,8 +14,8 @@ return new class extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::table('transactions', function (Blueprint $table) {
|
||||
$table->boolean('with_discount')->after('client_id')->nullable();
|
||||
$table->decimal('discount')->after('client_id')->nullable();
|
||||
$table->boolean('with_discount')->nullable();
|
||||
$table->decimal('discount')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<?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('transactionables', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('transaction_id');
|
||||
$table->unsignedBigInteger('transactionable_id');
|
||||
$table->string('transactionable_type');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('transactionables');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user