aboutsummaryrefslogtreecommitdiffhomepage
path: root/database/migrations/2018_06_30_203940_create_messages_table.php
diff options
context:
space:
mode:
authorMarvin Borner2018-06-30 23:44:50 +0200
committerMarvin Borner2018-06-30 23:44:50 +0200
commitb1c501e2f239ef6dcbf5e55e403834d793c6a0f6 (patch)
tree4532adc1e40f0da7580132b2a82c67c946a478f3 /database/migrations/2018_06_30_203940_create_messages_table.php
parent70233ba2d306019d415b94e270d3a90672236544 (diff)
Finished websocket integration
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