feat: add document_type column and methods

This commit is contained in:
Tanmay Deep Sharma
2025-06-24 01:47:52 +05:30
parent ed229eb1ae
commit b9d022ab68
5 changed files with 53 additions and 19 deletions
@@ -0,0 +1,6 @@
class AddDocumentTypeAndFileToCaptainDocuments < ActiveRecord::Migration[7.0]
def change
add_column :captain_documents, :document_type, :integer, default: 0, null: false
add_index :captain_documents, :document_type
end
end
+4 -2
View File
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.1].define(version: 2025_05_23_031839) do
ActiveRecord::Schema[7.1].define(version: 2025_06_23_120000) do
# These extensions should be enabled to support this database
enable_extension "pg_stat_statements"
enable_extension "pg_trgm"
@@ -289,9 +289,11 @@ ActiveRecord::Schema[7.1].define(version: 2025_05_23_031839) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "status", default: 0, null: false
t.integer "document_type", default: 0, null: false
t.index ["account_id"], name: "index_captain_documents_on_account_id"
t.index ["assistant_id", "external_link"], name: "index_captain_documents_on_assistant_id_and_external_link", unique: true
t.index ["assistant_id"], name: "index_captain_documents_on_assistant_id"
t.index ["document_type"], name: "index_captain_documents_on_document_type"
t.index ["status"], name: "index_captain_documents_on_status"
end
@@ -907,7 +909,7 @@ ActiveRecord::Schema[7.1].define(version: 2025_05_23_031839) do
t.text "header_text"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.jsonb "config", default: {"allowed_locales"=>["en"]}
t.jsonb "config", default: {"allowed_locales" => ["en"]}
t.boolean "archived", default: false
t.bigint "channel_web_widget_id"
t.index ["channel_web_widget_id"], name: "index_portals_on_channel_web_widget_id"