From 5208a70a664ff9c8b80c13fd932cf92ee1c1b809 Mon Sep 17 00:00:00 2001
From: Arnaud Levy <contact@arnaudlevy.com>
Date: Mon, 13 Feb 2023 09:37:05 +0100
Subject: [PATCH] index on docid

---
 app/models/research/publication.rb      | 6 +++++-
 db/schema.rb                            | 7 ++++---
 test/fixtures/research/publications.yml | 6 +++++-
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/app/models/research/publication.rb b/app/models/research/publication.rb
index 5100f60a9..d11c10516 100644
--- a/app/models/research/publication.rb
+++ b/app/models/research/publication.rb
@@ -4,7 +4,7 @@
 #
 #  id               :uuid             not null, primary key
 #  data             :jsonb
-#  docid            :string
+#  docid            :string           indexed
 #  doi              :string
 #  hal_url          :string
 #  publication_date :date
@@ -15,6 +15,10 @@
 #  created_at       :datetime         not null
 #  updated_at       :datetime         not null
 #
+# Indexes
+#
+#  index_research_publications_on_docid  (docid)
+#
 class Research::Publication < ApplicationRecord
   include WithGit
   include WithSlug
diff --git a/db/schema.rb b/db/schema.rb
index b2bd68898..2d9fa7c66 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema[7.0].define(version: 2023_02_10_132818) do
+ActiveRecord::Schema[7.0].define(version: 2023_02_13_083544) do
   # These are extensions that must be enabled in order to support this database
   enable_extension "pgcrypto"
   enable_extension "plpgsql"
@@ -697,6 +697,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_10_132818) do
     t.date "publication_date"
     t.string "doi"
     t.string "slug"
+    t.index ["docid"], name: "index_research_publications_on_docid"
   end
 
   create_table "research_publications_university_people", id: false, force: :cascade do |t|
@@ -811,11 +812,11 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_10_132818) do
     t.string "city"
     t.string "country"
     t.string "hal_person_identifier"
+    t.string "hal_doc_identifier"
+    t.string "hal_form_identifier"
     t.string "mastodon"
     t.uuid "language_id", null: false
     t.uuid "original_id"
-    t.string "hal_doc_identifier"
-    t.string "hal_form_identifier"
     t.index ["language_id"], name: "index_university_people_on_language_id"
     t.index ["original_id"], name: "index_university_people_on_original_id"
     t.index ["university_id"], name: "index_university_people_on_university_id"
diff --git a/test/fixtures/research/publications.yml b/test/fixtures/research/publications.yml
index 1b4f3a0cf..2ccd47c2e 100644
--- a/test/fixtures/research/publications.yml
+++ b/test/fixtures/research/publications.yml
@@ -4,7 +4,7 @@
 #
 #  id               :uuid             not null, primary key
 #  data             :jsonb
-#  docid            :string
+#  docid            :string           indexed
 #  doi              :string
 #  hal_url          :string
 #  publication_date :date
@@ -15,6 +15,10 @@
 #  created_at       :datetime         not null
 #  updated_at       :datetime         not null
 #
+# Indexes
+#
+#  index_research_publications_on_docid  (docid)
+#
 
 default_publication:
   docid: MyString
-- 
GitLab