Redo database migrations for pgsql
This commit is contained in:
46
database/migrations/0201-create_products.php
Normal file
46
database/migrations/0201-create_products.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?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('products', function(Blueprint $table)
|
||||
{
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
$table->integer('site_id')->unsigned();
|
||||
$table->boolean('active')->default(false);
|
||||
|
||||
$table->boolean('taxable')->default(true);
|
||||
$table->integer('position')->nullable();
|
||||
$table->text('pricing');
|
||||
$table->integer('price_recur_default')->nullable();
|
||||
$table->boolean('price_recur_strict')->nullable();
|
||||
$table->integer('model_id');
|
||||
$table->string('model')->nullable();
|
||||
|
||||
$table->foreign(['site_id'])->references(['id'])->on('sites');
|
||||
|
||||
$table->unique(['id','site_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('products');
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user