init crater

This commit is contained in:
Mohit Panjwani
2019-11-11 12:16:00 +05:30
commit bdf2ba51d6
668 changed files with 158503 additions and 0 deletions

View 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');
}
}