aboutsummaryrefslogtreecommitdiffhomepage
path: root/database/migrations/2018_06_30_203940_create_messages_table.php
diff options
context:
space:
mode:
Diffstat (limited to 'database/migrations/2018_06_30_203940_create_messages_table.php')
-rw-r--r--database/migrations/2018_06_30_203940_create_messages_table.php34
1 files changed, 34 insertions, 0 deletions
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