浏览代码

Add db migration, add profile indexes

Daniel Supernault 2 年之前
父节点
当前提交
3295dfa16e
共有 1 个文件被更改,包括 34 次插入0 次删除
  1. 34 0
      database/migrations/2022_12_05_064156_add_key_id_index_to_profiles_table.php

+ 34 - 0
database/migrations/2022_12_05_064156_add_key_id_index_to_profiles_table.php

@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('profiles', function (Blueprint $table) {
+            $table->index('key_id');
+            $table->index('remote_url');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('profiles', function (Blueprint $table) {
+            $table->dropIndex('profiles_key_id_index');
+            $table->dropIndex('profiles_remote_url_index');
+        });
+    }
+};