浏览代码

Add DefaultDomainBlock model + migration

Daniel Supernault 1 年之前
父节点
当前提交
f3f0175c84

+ 13 - 0
app/Models/DefaultDomainBlock.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+
+class DefaultDomainBlock extends Model
+{
+    use HasFactory;
+
+    protected $guarded = [];
+}

+ 29 - 0
database/migrations/2023_12_21_104103_create_default_domain_blocks_table.php

@@ -0,0 +1,29 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+    /**
+     * Run the migrations.
+     */
+    public function up(): void
+    {
+        Schema::create('default_domain_blocks', function (Blueprint $table) {
+            $table->id();
+            $table->string('domain')->unique()->index();
+            $table->text('note')->nullable();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     */
+    public function down(): void
+    {
+        Schema::dropIfExists('default_domain_blocks');
+    }
+};