1: <?php use Illuminate\Database\Schema\Blueprint;
2: use Illuminate\Database\Migrations\Migration;
3: class CreateContactsTable extends Migration {
4:
5: 6: 7: 8: 9:
10: public function up()
11: {
12: if (!Schema::hasTable('contacts'))
13: {
14: Schema::create('contacts', function(Blueprint $table)
15: {
16: $table->increments('id');
17: $table->integer('user_id')->unsigned()->nullable();
18: $table->integer('first_name')->unsigned()->nullable();
19: $table->integer('last_name')->unsigned()->nullable();
20: $table->integer('email_address')->unsigned()->nullable();
21: $table->integer('address01')->unsigned()->nullable();
22: $table->integer('address02')->unsigned()->nullable();
23: $table->integer('address03')->unsigned()->nullable();
24: $table->integer('address04')->unsigned()->nullable();
25: $table->integer('postal_code')->unsigned()->nullable();
26: $table->timestamps();
27: });
28: }
29: }
30:
31: 32: 33: 34: 35:
36: public function down()
37: {
38: Schema::dropIfExists('contacts');
39: }
40:
41: }