This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
memberdb/database/migrations/2017_07_23_000400_create_site_table.php
2017-08-03 16:35:36 +10:00

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