mirror of
https://github.com/crater-invoice/crater.git
synced 2025-12-16 02:12:54 -05:00
init crater
This commit is contained in:
49
database/migrations/2019_09_21_052548_create_taxes_table.php
Normal file
49
database/migrations/2019_09_21_052548_create_taxes_table.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
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->decimal('amount', 15, 0);
|
||||
$table->decimal('percent', 5, 2);
|
||||
$table->tinyInteger('compound_tax')->default(0);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('taxes');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user