46 lines
1013 B
PHP
46 lines
1013 B
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
|
||
|
class CreateSiteTable extends Migration {
|
||
|
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
Schema::create('site', function(Blueprint $table)
|
||
|
{
|
||
|
$table->integer('id',TRUE);
|
||
|
$table->string('name', 64)->nullable();
|
||
|
$table->unique(['id','name']);
|
||
|
$table->string('description',128)->nullable();
|
||
|
$table->string('address1',128)->nullable();
|
||
|
$table->string('address2',128)->nullable();
|
||
|
$table->string('city',32)->nullable();
|
||
|
$table->string('state',3)->nullable();
|
||
|
$table->string('postalcode',8)->nullable();
|
||
|
$table->string('phone',16)->nullable();
|
||
|
$table->string('email',32)->nullable();
|
||
|
$table->integer('setup_id');
|
||
|
|
||
|
$table->foreign('setup_id')->references('id')->on('setup')->onUpdate('NO ACTION')->onDelete('NO ACTION');
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
Schema::drop('site');
|
||
|
}
|
||
|
|
||
|
}
|