Selaa lähdekoodia

Add Notification model/migration

Daniel Supernault 7 vuotta sitten
vanhempi
commit
e52f81fc2a

+ 10 - 0
app/Notification.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Notification extends Model
+{
+    //
+}

+ 37 - 0
database/migrations/2018_05_07_025743_create_notifications_table.php

@@ -0,0 +1,37 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateNotificationsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('notifications', function (Blueprint $table) {
+            $table->bigIncrements('id');
+            $table->bigInteger('profile_id')->unsigned()->index();
+            $table->bigInteger('actor_id')->unsigned()->nullable();
+            $table->string('action')->nullable();
+            $table->string('message')->nullable();
+            $table->string('rendered')->nullable();
+            $table->timestamp('read_at')->nullable();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('notifications');
+    }
+}