diff options
Diffstat (limited to 'database')
3 files changed, 38 insertions, 8 deletions
diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 689cbee..0b20550 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -1,8 +1,7 @@ <?php - -use Illuminate\Support\Facades\Schema; -use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateUsersTable extends Migration { @@ -22,7 +21,6 @@ class CreateUsersTable extends Migration $table->timestamps(); }); } - /** * Reverse the migrations. * diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php index 0d5cb84..0dd2748 100644 --- a/database/migrations/2014_10_12_100000_create_password_resets_table.php +++ b/database/migrations/2014_10_12_100000_create_password_resets_table.php @@ -1,8 +1,7 @@ <?php - -use Illuminate\Support\Facades\Schema; -use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreatePasswordResetsTable extends Migration { @@ -19,7 +18,6 @@ class CreatePasswordResetsTable extends Migration $table->timestamp('created_at')->nullable(); }); } - /** * Reverse the migrations. * diff --git a/database/migrations/2018_06_30_203940_create_messages_table.php b/database/migrations/2018_06_30_203940_create_messages_table.php new file mode 100644 index 0000000..f24bf21 --- /dev/null +++ b/database/migrations/2018_06_30_203940_create_messages_table.php @@ -0,0 +1,34 @@ +<?php + +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Database\Migrations\Migration; + +class CreateMessagesTable extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('messages', function (Blueprint $table) { + $table->increments('id'); + $table->integer('user_id')->unsigned(); + $table->text('message'); + $table->timestamps(); + + $table->foreign('user_id')->references('id')->on('users'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('messages'); + } +}
\ No newline at end of file |