Redo database migrations for pgsql
This commit is contained in:
46
database/migrations/0050-create_sites.php
Normal file
46
database/migrations/0050-create_sites.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('sites', function(Blueprint $table)
|
||||
{
|
||||
$table->id();
|
||||
$table->integer('site_id')->unsigned();
|
||||
$table->boolean('active')->default(false);
|
||||
|
||||
$table->integer('admin_id')->unsigned()->nullable();
|
||||
|
||||
$table->string('url',256)->unique();
|
||||
|
||||
$table->integer('country_id');
|
||||
$table->integer('currency_id');
|
||||
$table->foreign(['country_id','currency_id'])->references(['id','currency_id'])->on('countries');
|
||||
|
||||
$table->integer('language_id');
|
||||
$table->foreign('language_id')->references('id')->on('languages');
|
||||
|
||||
$table->unique(['id','site_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('sites');
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user