Redo database migrations for pgsql
This commit is contained in:
41
database/migrations/0262-create_invoice_item_tax.php
Normal file
41
database/migrations/0262-create_invoice_item_tax.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('invoice_item_taxes', function(Blueprint $table)
|
||||
{
|
||||
$table->id();
|
||||
$table->integer('site_id')->unsigned();
|
||||
$table->boolean('active')->default(true);
|
||||
|
||||
$table->float('amount',10,0);
|
||||
|
||||
$table->integer('invoice_item_id')->unsigned();
|
||||
$table->foreign(['invoice_item_id','site_id'])->references(['id','site_id'])->on('invoice_items');
|
||||
|
||||
$table->integer('tax_id')->unsigned();
|
||||
$table->foreign('tax_id')->references('id')->on('taxes');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('invoice_item_taxes');
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user