mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
* Create PHP CS Fixer config and add to CI workflow * Run php cs fixer on project * Add newline at end of file * Update to use PHP CS Fixer v3 * Run v3 config on project * Run seperate config in CI
50 lines
1.9 KiB
PHP
50 lines
1.9 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateTaxesTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('taxes', function (Blueprint $table) {
|
|
$table->increments('id');
|
|
$table->integer('tax_type_id')->unsigned();
|
|
$table->foreign('tax_type_id')->references('id')->on('tax_types');
|
|
$table->integer('invoice_id')->unsigned()->nullable();
|
|
$table->foreign('invoice_id')->references('id')->on('invoices')->onDelete('cascade');
|
|
$table->integer('estimate_id')->unsigned()->nullable();
|
|
$table->foreign('estimate_id')->references('id')->on('estimates')->onDelete('cascade');
|
|
$table->integer('invoice_item_id')->unsigned()->nullable();
|
|
$table->foreign('invoice_item_id')->references('id')->on('invoice_items')->onDelete('cascade');
|
|
$table->integer('estimate_item_id')->unsigned()->nullable();
|
|
$table->foreign('estimate_item_id')->references('id')->on('estimate_items')->onDelete('cascade');
|
|
$table->integer('item_id')->unsigned()->nullable();
|
|
$table->foreign('item_id')->references('id')->on('items')->onDelete('cascade');
|
|
$table->integer('company_id')->unsigned()->nullable();
|
|
$table->foreign('company_id')->references('id')->on('companies');
|
|
$table->string('name');
|
|
$table->unsignedBigInteger('amount');
|
|
$table->decimal('percent', 5, 2);
|
|
$table->tinyInteger('compound_tax')->default(0);
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('taxes');
|
|
}
|
|
}
|