Set contact and subscription table fields nullable and use bigIncrements for the contact, subscription and blog table ids

This commit is contained in:
Kevin MacMartin 2019-04-28 23:37:58 -04:00
parent 2a88427c2f
commit 63021ea93c
3 changed files with 8 additions and 8 deletions

View file

@ -14,10 +14,10 @@ class AddContactTable extends Migration
public function up()
{
Schema::create('contact', function(Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email');
$table->text('message');
$table->bigIncrements('id');
$table->string('name')->nullable();
$table->string('email')->nullable();
$table->text('message')->nullable();
$table->timestamps();
});
}

View file

@ -14,9 +14,9 @@ class AddSubscriptionTable extends Migration
public function up()
{
Schema::create('subscriptions', function(Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email');
$table->bigIncrements('id');
$table->string('name')->nullable();
$table->string('email')->nullable();
$table->timestamps();
});
}

View file

@ -14,7 +14,7 @@ class AddBlogTable extends Migration
public function up()
{
Schema::create('blog', function(Blueprint $table) {
$table->increments('id');
$table->bigIncrements('id');
$table->bigInteger('user_id')->unsigned();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->string('title')->nullable();