Add migrations for existing database
This commit is contained in:
49
database/migrations/2017_06_18_104531_create_users_table.php
Normal file
49
database/migrations/2017_06_18_104531_create_users_table.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateUsersTable extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('users', function(Blueprint $table)
|
||||
{
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('site_id');
|
||||
$table->string('email', 191);
|
||||
$table->string('password', 191)->nullable();
|
||||
$table->string('remember_token', 100)->nullable();
|
||||
$table->boolean('active');
|
||||
$table->string('title', 191)->nullable();
|
||||
$table->string('firstname', 191);
|
||||
$table->string('lastname', 191);
|
||||
$table->integer('country_id');
|
||||
$table->string('address1', 191)->nullable();
|
||||
$table->string('address2', 191)->nullable();
|
||||
$table->string('city', 191)->nullable();
|
||||
$table->string('state', 191)->nullable();
|
||||
$table->string('postcode', 191)->nullable();
|
||||
$table->boolean('emailable')->default(1);
|
||||
$table->unique(['site_id','email']);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('users');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user