visuddhinanda 2 năm trước cách đây
mục cha
commit
03d8ab2224

+ 11 - 0
app/Models/Attachment.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+
+class Attachment extends Model
+{
+    use HasFactory;
+}

+ 40 - 0
database/migrations/2023_06_15_021837_create_attachments_table.php

@@ -0,0 +1,40 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateAttachmentsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('attachments', function (Blueprint $table) {
+            $table->uuid("id")->primary();
+            $table->uuid("user_uid")->index();
+            $table->string('bucket',255)->index();
+            $table->string('name',63)->index();
+            $table->string('title',255)->index();
+            $table->bigInteger('size')->index();
+            $table->string('content_type',63);
+            $table->string('status',16)->index();
+            $table->integer('version')->default(0);
+            $table->timestamp('deleted_at')->nullable()->index();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('attachments');
+    }
+}