Update Gemfile.lock and improve database schema comments

- Added new gems: axe-core-api, axe-core-rspec, axiom-types, coercible, descendants_tracker, dumb_delegator, and virtus for enhanced accessibility and data handling.
- Updated database schema comments for clarity, ensuring proper formatting for index definitions in document_generation_event.rb, email_event.rb, lock_event.rb, submission_event.rb, and submission.rb.
- Adjusted the schema version in db/schema.rb to reflect the latest changes.

These updates contribute to ongoing accessibility improvements and maintain code clarity.
pull/599/head
Marcelo Paiva 3 weeks ago
parent 79635ef2c5
commit 4602f0fb63

@ -0,0 +1 @@
4.0.1

@ -112,6 +112,19 @@ GEM
aws-sigv4 (~> 1.5)
aws-sigv4 (1.12.1)
aws-eventstream (~> 1, >= 1.0.2)
axe-core-api (4.11.1)
dumb_delegator
ostruct
virtus
axe-core-rspec (4.11.1)
axe-core-api (= 4.11.1)
dumb_delegator
ostruct
virtus
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
azure-blob (0.8.0)
cgi
rexml
@ -152,6 +165,8 @@ GEM
cldr-plurals-runtime-rb (1.1.0)
cmdparse (3.0.7)
coderay (1.1.3)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
concurrent-ruby (1.3.6)
connection_pool (3.0.2)
crack (1.0.1)
@ -171,6 +186,8 @@ GEM
irb (~> 1.10)
reline (>= 0.3.8)
declarative (0.0.20)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
devise (4.9.4)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
@ -188,6 +205,7 @@ GEM
docile (1.4.1)
dotenv (3.2.0)
drb (2.2.3)
dumb_delegator (1.1.0)
email_typo (0.2.3)
erb (6.0.1)
erb_lint (0.9.0)
@ -276,6 +294,7 @@ GEM
htmlentities (4.4.2)
i18n (1.14.8)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
image_processing (1.14.0)
mini_magick (>= 4.9.5, < 6)
ruby-vips (>= 2.0.17, < 3)
@ -568,6 +587,7 @@ GEM
activemodel (>= 3.0, < 9.0)
strscan (3.1.7)
thor (1.5.0)
thread_safe (0.3.6)
timeout (0.6.0)
trailblazer-option (0.1.2)
tsort (0.2.0)
@ -590,6 +610,10 @@ GEM
uniform_notifier (1.18.0)
uri (1.1.1)
useragent (0.16.11)
virtus (2.0.0)
axiom-types (~> 0.1)
coercible (~> 1.0)
descendants_tracker (~> 0.0, >= 0.0.3)
warden (1.2.9)
rack (>= 2.0.9)
web-console (4.2.1)
@ -623,6 +647,7 @@ DEPENDENCIES
arabic-letter-connector
aws-sdk-s3
aws-sdk-secretsmanager
axe-core-rspec
azure-blob
better_html
bootsnap

@ -13,7 +13,7 @@
# Indexes
#
# index_document_generation_events_on_submitter_id (submitter_id)
# index_document_generation_events_on_submitter_id_and_event_name (submitter_id,event_name) UNIQUE WHERE ((event_name)::text = ANY ((ARRAY['start'::character varying, 'complete'::character varying])::text[]))
# index_document_generation_events_on_submitter_id_and_event_name (submitter_id,event_name) UNIQUE WHERE ((event_name)::text = ANY (ARRAY[('start'::character varying)::text, ('complete'::character varying)::text]))
#
# Foreign Keys
#

@ -20,7 +20,7 @@
#
# index_email_events_on_account_id_and_event_datetime (account_id,event_datetime)
# index_email_events_on_email (email)
# index_email_events_on_email_event_types (email) WHERE ((event_type)::text = ANY ((ARRAY['bounce'::character varying, 'soft_bounce'::character varying, 'permanent_bounce'::character varying, 'complaint'::character varying, 'soft_complaint'::character varying])::text[]))
# index_email_events_on_email_event_types (email) WHERE ((event_type)::text = ANY (ARRAY[('bounce'::character varying)::text, ('soft_bounce'::character varying)::text, ('permanent_bounce'::character varying)::text, ('complaint'::character varying)::text, ('soft_complaint'::character varying)::text]))
# index_email_events_on_emailable (emailable_type,emailable_id)
# index_email_events_on_message_id (message_id)
#

@ -12,7 +12,7 @@
#
# Indexes
#
# index_lock_events_on_event_name_and_key (event_name,key) UNIQUE WHERE ((event_name)::text = ANY ((ARRAY['start'::character varying, 'complete'::character varying])::text[]))
# index_lock_events_on_event_name_and_key (event_name,key) UNIQUE WHERE ((event_name)::text = ANY (ARRAY[('start'::character varying)::text, ('complete'::character varying)::text]))
# index_lock_events_on_key (key)
#
class LockEvent < ApplicationRecord

@ -10,7 +10,7 @@
# name :text
# preferences :text not null
# slug :string not null
# source :text not null
# source :string not null
# submitters_order :string not null
# template_fields :text
# template_schema :text

@ -20,7 +20,7 @@
# index_submission_events_on_created_at (created_at)
# index_submission_events_on_submission_id (submission_id)
# index_submission_events_on_submitter_id (submitter_id)
# index_submissions_events_on_sms_event_types (account_id,created_at) WHERE ((event_type)::text = ANY ((ARRAY['send_sms'::character varying, 'send_2fa_sms'::character varying])::text[]))
# index_submissions_events_on_sms_event_types (account_id,created_at) WHERE ((event_type)::text = ANY (ARRAY[('send_sms'::character varying)::text, ('send_2fa_sms'::character varying)::text]))
#
# Foreign Keys
#

@ -10,44 +10,44 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.0].define(version: 2025_11_25_194305) do
ActiveRecord::Schema[8.1].define(version: 2025_11_25_194305) do
# These are extensions that must be enabled in order to support this database
enable_extension "btree_gin"
enable_extension "plpgsql"
enable_extension "pg_catalog.plpgsql"
create_table "access_tokens", force: :cascade do |t|
t.bigint "user_id", null: false
t.text "token", null: false
t.text "sha256", null: false
t.datetime "created_at", null: false
t.text "sha256", null: false
t.text "token", null: false
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.index ["sha256"], name: "index_access_tokens_on_sha256", unique: true
t.index ["user_id"], name: "index_access_tokens_on_user_id"
end
create_table "account_accesses", force: :cascade do |t|
t.bigint "account_id", null: false
t.bigint "user_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.index ["account_id", "user_id"], name: "index_account_accesses_on_account_id_and_user_id", unique: true
end
create_table "account_configs", force: :cascade do |t|
t.bigint "account_id", null: false
t.string "key", null: false
t.text "value", null: false
t.datetime "created_at", null: false
t.string "key", null: false
t.datetime "updated_at", null: false
t.text "value", null: false
t.index ["account_id", "key"], name: "index_account_configs_on_account_id_and_key", unique: true
t.index ["account_id"], name: "index_account_configs_on_account_id"
end
create_table "account_linked_accounts", force: :cascade do |t|
t.bigint "account_id", null: false
t.bigint "linked_account_id", null: false
t.text "account_type", null: false
t.datetime "created_at", null: false
t.bigint "linked_account_id", null: false
t.datetime "updated_at", null: false
t.index ["account_id", "linked_account_id"], name: "idx_on_account_id_linked_account_id_48ab9f79d2", unique: true
t.index ["account_id"], name: "index_account_linked_accounts_on_account_id"
@ -55,37 +55,37 @@ ActiveRecord::Schema[8.0].define(version: 2025_11_25_194305) do
end
create_table "accounts", force: :cascade do |t|
t.datetime "archived_at"
t.datetime "created_at", null: false
t.string "locale", null: false
t.string "name", null: false
t.string "timezone", null: false
t.string "locale", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "uuid", null: false
t.datetime "archived_at"
t.index ["uuid"], name: "index_accounts_on_uuid", unique: true
end
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
t.string "uuid", null: false
t.string "record_type", null: false
t.bigint "record_id", null: false
t.bigint "blob_id", null: false
t.datetime "created_at", null: false
t.string "name", null: false
t.bigint "record_id", null: false
t.string "record_type", null: false
t.string "uuid", null: false
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
t.index ["record_type", "record_id", "name", "blob_id"], name: "idx_on_record_type_record_id_name_blob_id_0be5805727"
t.index ["uuid"], name: "index_active_storage_attachments_on_uuid"
end
create_table "active_storage_blobs", force: :cascade do |t|
t.string "key", null: false
t.string "filename", null: false
t.string "content_type"
t.text "metadata"
t.string "service_name", null: false
t.bigint "byte_size", null: false
t.string "checksum"
t.string "content_type"
t.datetime "created_at", null: false
t.string "filename", null: false
t.string "key", null: false
t.text "metadata"
t.string "service_name", null: false
t.string "uuid"
t.index ["checksum"], name: "index_active_storage_blobs_on_checksum"
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
@ -99,26 +99,26 @@ ActiveRecord::Schema[8.0].define(version: 2025_11_25_194305) do
end
create_table "completed_documents", force: :cascade do |t|
t.bigint "submitter_id", null: false
t.string "sha256", null: false
t.datetime "created_at", null: false
t.string "sha256", null: false
t.bigint "submitter_id", null: false
t.datetime "updated_at", null: false
t.index ["sha256"], name: "index_completed_documents_on_sha256"
t.index ["submitter_id"], name: "index_completed_documents_on_submitter_id"
end
create_table "completed_submitters", force: :cascade do |t|
t.bigint "submitter_id", null: false
t.bigint "submission_id", null: false
t.bigint "account_id", null: false
t.bigint "template_id"
t.string "source", null: false
t.integer "sms_count", null: false
t.datetime "completed_at", null: false
t.datetime "created_at", null: false
t.boolean "is_first"
t.integer "sms_count", null: false
t.string "source", null: false
t.bigint "submission_id", null: false
t.bigint "submitter_id", null: false
t.bigint "template_id"
t.datetime "updated_at", null: false
t.string "verification_method"
t.boolean "is_first"
t.index ["account_id", "completed_at"], name: "index_completed_submitters_account_id_completed_at_is_first", where: "(is_first = true)"
t.index ["account_id", "completed_at"], name: "index_completed_submitters_on_account_id_and_completed_at"
t.index ["submission_id"], name: "index_completed_submitters_on_submission_id", unique: true, where: "(is_first = true)"
@ -126,75 +126,75 @@ ActiveRecord::Schema[8.0].define(version: 2025_11_25_194305) do
end
create_table "console1984_commands", force: :cascade do |t|
t.text "statements"
t.datetime "created_at", null: false
t.bigint "sensitive_access_id"
t.bigint "session_id", null: false
t.datetime "created_at", null: false
t.text "statements"
t.datetime "updated_at", null: false
t.index ["sensitive_access_id"], name: "index_console1984_commands_on_sensitive_access_id"
t.index ["session_id", "created_at", "sensitive_access_id"], name: "on_session_and_sensitive_chronologically"
end
create_table "console1984_sensitive_accesses", force: :cascade do |t|
t.datetime "created_at", null: false
t.text "justification"
t.bigint "session_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["session_id"], name: "index_console1984_sensitive_accesses_on_session_id"
end
create_table "console1984_sessions", force: :cascade do |t|
t.text "reason"
t.bigint "user_id", null: false
t.datetime "created_at", null: false
t.text "reason"
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.index ["created_at"], name: "index_console1984_sessions_on_created_at"
t.index ["user_id", "created_at"], name: "index_console1984_sessions_on_user_id_and_created_at"
end
create_table "console1984_users", force: :cascade do |t|
t.string "username", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "username", null: false
t.index ["username"], name: "index_console1984_users_on_username"
end
create_table "document_generation_events", force: :cascade do |t|
t.bigint "submitter_id", null: false
t.string "event_name", null: false
t.datetime "created_at", null: false
t.string "event_name", null: false
t.bigint "submitter_id", null: false
t.datetime "updated_at", null: false
t.index ["submitter_id", "event_name"], name: "index_document_generation_events_on_submitter_id_and_event_name", unique: true, where: "((event_name)::text = ANY ((ARRAY['start'::character varying, 'complete'::character varying])::text[]))"
t.index ["submitter_id", "event_name"], name: "index_document_generation_events_on_submitter_id_and_event_name", unique: true, where: "((event_name)::text = ANY (ARRAY[('start'::character varying)::text, ('complete'::character varying)::text]))"
t.index ["submitter_id"], name: "index_document_generation_events_on_submitter_id"
end
create_table "email_events", force: :cascade do |t|
t.bigint "account_id", null: false
t.string "emailable_type", null: false
t.datetime "created_at", null: false
t.text "data", null: false
t.string "email", null: false
t.bigint "emailable_id", null: false
t.string "emailable_type", null: false
t.datetime "event_datetime", null: false
t.string "event_type", null: false
t.string "message_id", null: false
t.string "tag", null: false
t.string "event_type", null: false
t.string "email", null: false
t.text "data", null: false
t.datetime "event_datetime", null: false
t.datetime "created_at", null: false
t.index ["account_id", "event_datetime"], name: "index_email_events_on_account_id_and_event_datetime"
t.index ["email"], name: "index_email_events_on_email"
t.index ["email"], name: "index_email_events_on_email_event_types", where: "((event_type)::text = ANY ((ARRAY['bounce'::character varying, 'soft_bounce'::character varying, 'permanent_bounce'::character varying, 'complaint'::character varying, 'soft_complaint'::character varying])::text[]))"
t.index ["email"], name: "index_email_events_on_email_event_types", where: "((event_type)::text = ANY (ARRAY[('bounce'::character varying)::text, ('soft_bounce'::character varying)::text, ('permanent_bounce'::character varying)::text, ('complaint'::character varying)::text, ('soft_complaint'::character varying)::text]))"
t.index ["emailable_type", "emailable_id"], name: "index_email_events_on_emailable"
t.index ["message_id"], name: "index_email_events_on_message_id"
end
create_table "email_messages", force: :cascade do |t|
t.string "uuid", null: false
t.bigint "author_id", null: false
t.bigint "account_id", null: false
t.text "subject", null: false
t.bigint "author_id", null: false
t.text "body", null: false
t.string "sha1", null: false
t.datetime "created_at", null: false
t.string "sha1", null: false
t.text "subject", null: false
t.datetime "updated_at", null: false
t.string "uuid", null: false
t.index ["account_id"], name: "index_email_messages_on_account_id"
t.index ["sha1"], name: "index_email_messages_on_sha1"
t.index ["uuid"], name: "index_email_messages_on_uuid"
@ -202,57 +202,57 @@ ActiveRecord::Schema[8.0].define(version: 2025_11_25_194305) do
create_table "encrypted_configs", force: :cascade do |t|
t.bigint "account_id", null: false
t.string "key", null: false
t.text "value", null: false
t.datetime "created_at", null: false
t.string "key", null: false
t.datetime "updated_at", null: false
t.text "value", null: false
t.index ["account_id", "key"], name: "index_encrypted_configs_on_account_id_and_key", unique: true
t.index ["account_id"], name: "index_encrypted_configs_on_account_id"
end
create_table "encrypted_user_configs", force: :cascade do |t|
t.bigint "user_id", null: false
t.string "key", null: false
t.text "value", null: false
t.datetime "created_at", null: false
t.string "key", null: false
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.text "value", null: false
t.index ["user_id", "key"], name: "index_encrypted_user_configs_on_user_id_and_key", unique: true
t.index ["user_id"], name: "index_encrypted_user_configs_on_user_id"
end
create_table "lock_events", force: :cascade do |t|
t.string "key", null: false
t.string "event_name", null: false
t.datetime "created_at", null: false
t.string "event_name", null: false
t.string "key", null: false
t.datetime "updated_at", null: false
t.index ["event_name", "key"], name: "index_lock_events_on_event_name_and_key", unique: true, where: "((event_name)::text = ANY ((ARRAY['start'::character varying, 'complete'::character varying])::text[]))"
t.index ["event_name", "key"], name: "index_lock_events_on_event_name_and_key", unique: true, where: "((event_name)::text = ANY (ARRAY[('start'::character varying)::text, ('complete'::character varying)::text]))"
t.index ["key"], name: "index_lock_events_on_key"
end
create_table "oauth_access_grants", force: :cascade do |t|
t.bigint "resource_owner_id", null: false
t.bigint "application_id", null: false
t.string "token", null: false
t.datetime "created_at", null: false
t.integer "expires_in", null: false
t.text "redirect_uri", null: false
t.string "scopes", default: "", null: false
t.datetime "created_at", null: false
t.bigint "resource_owner_id", null: false
t.datetime "revoked_at"
t.string "scopes", default: "", null: false
t.string "token", null: false
t.index ["application_id"], name: "index_oauth_access_grants_on_application_id"
t.index ["resource_owner_id"], name: "index_oauth_access_grants_on_resource_owner_id"
t.index ["token"], name: "index_oauth_access_grants_on_token", unique: true
end
create_table "oauth_access_tokens", force: :cascade do |t|
t.bigint "resource_owner_id"
t.bigint "application_id", null: false
t.string "token", null: false
t.string "refresh_token"
t.integer "expires_in"
t.string "scopes"
t.datetime "created_at", null: false
t.datetime "revoked_at"
t.integer "expires_in"
t.string "previous_refresh_token", default: "", null: false
t.string "refresh_token"
t.bigint "resource_owner_id"
t.datetime "revoked_at"
t.string "scopes"
t.string "token", null: false
t.index ["application_id"], name: "index_oauth_access_tokens_on_application_id"
t.index ["refresh_token"], name: "index_oauth_access_tokens_on_refresh_token", unique: true
t.index ["resource_owner_id"], name: "index_oauth_access_tokens_on_resource_owner_id"
@ -260,25 +260,25 @@ ActiveRecord::Schema[8.0].define(version: 2025_11_25_194305) do
end
create_table "oauth_applications", force: :cascade do |t|
t.boolean "confidential", default: true, null: false
t.datetime "created_at", null: false
t.string "name", null: false
t.string "uid", null: false
t.string "secret", null: false
t.text "redirect_uri"
t.string "scopes", default: "", null: false
t.boolean "confidential", default: true, null: false
t.datetime "created_at", null: false
t.string "secret", null: false
t.string "uid", null: false
t.datetime "updated_at", null: false
t.index ["uid"], name: "index_oauth_applications_on_uid", unique: true
end
create_table "search_entries", force: :cascade do |t|
t.string "record_type", null: false
t.bigint "record_id", null: false
t.bigint "account_id", null: false
t.tsvector "tsvector", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.tsvector "ngram"
t.bigint "record_id", null: false
t.string "record_type", null: false
t.tsvector "tsvector", null: false
t.datetime "updated_at", null: false
t.index ["account_id", "ngram"], name: "index_search_entries_on_account_id_ngram_submission", where: "((record_type)::text = 'Submission'::text)", using: :gin
t.index ["account_id", "ngram"], name: "index_search_entries_on_account_id_ngram_submitter", where: "((record_type)::text = 'Submitter'::text)", using: :gin
t.index ["account_id", "ngram"], name: "index_search_entries_on_account_id_ngram_template", where: "((record_type)::text = 'Template'::text)", using: :gin
@ -289,15 +289,15 @@ ActiveRecord::Schema[8.0].define(version: 2025_11_25_194305) do
end
create_table "submission_events", force: :cascade do |t|
t.bigint "submission_id", null: false
t.bigint "submitter_id"
t.bigint "account_id"
t.datetime "created_at", null: false
t.text "data", null: false
t.string "event_type", null: false
t.datetime "event_timestamp", null: false
t.datetime "created_at", null: false
t.string "event_type", null: false
t.bigint "submission_id", null: false
t.bigint "submitter_id"
t.datetime "updated_at", null: false
t.bigint "account_id"
t.index ["account_id", "created_at"], name: "index_submissions_events_on_sms_event_types", where: "((event_type)::text = ANY ((ARRAY['send_sms'::character varying, 'send_2fa_sms'::character varying])::text[]))"
t.index ["account_id", "created_at"], name: "index_submissions_events_on_sms_event_types", where: "((event_type)::text = ANY (ARRAY[('send_sms'::character varying)::text, ('send_2fa_sms'::character varying)::text]))"
t.index ["account_id"], name: "index_submission_events_on_account_id"
t.index ["created_at"], name: "index_submission_events_on_created_at"
t.index ["submission_id"], name: "index_submission_events_on_submission_id"
@ -305,23 +305,23 @@ ActiveRecord::Schema[8.0].define(version: 2025_11_25_194305) do
end
create_table "submissions", force: :cascade do |t|
t.bigint "template_id"
t.bigint "created_by_user_id"
t.bigint "account_id", null: false
t.datetime "archived_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "created_by_user_id"
t.datetime "expire_at"
t.text "name"
t.text "preferences", null: false
t.string "slug", null: false
t.string "source", null: false
t.string "submitters_order", null: false
t.text "template_fields"
t.bigint "template_id"
t.text "template_schema"
t.text "template_submitters"
t.string "source", null: false
t.string "submitters_order", null: false
t.string "slug", null: false
t.text "preferences", null: false
t.bigint "account_id", null: false
t.datetime "expire_at"
t.text "name"
t.text "variables_schema"
t.datetime "updated_at", null: false
t.text "variables"
t.text "variables_schema"
t.index ["account_id", "id"], name: "index_submissions_on_account_id_and_id"
t.index ["account_id", "template_id", "id"], name: "index_submissions_on_account_id_and_template_id_and_id", where: "(archived_at IS NULL)"
t.index ["account_id", "template_id", "id"], name: "index_submissions_on_account_id_and_template_id_and_id_archived", where: "(archived_at IS NOT NULL)"
@ -331,26 +331,26 @@ ActiveRecord::Schema[8.0].define(version: 2025_11_25_194305) do
end
create_table "submitters", force: :cascade do |t|
t.bigint "submission_id", null: false
t.string "uuid", null: false
t.string "email"
t.string "slug", null: false
t.text "values", null: false
t.string "ua"
t.string "ip"
t.datetime "sent_at"
t.datetime "opened_at"
t.bigint "account_id", null: false
t.datetime "completed_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "declined_at"
t.string "email"
t.string "external_id"
t.string "ip"
t.text "metadata", null: false
t.string "name"
t.datetime "opened_at"
t.string "phone"
t.string "external_id"
t.text "preferences", null: false
t.text "metadata", null: false
t.bigint "account_id", null: false
t.datetime "declined_at"
t.datetime "sent_at"
t.string "slug", null: false
t.bigint "submission_id", null: false
t.string "timezone"
t.string "ua"
t.datetime "updated_at", null: false
t.string "uuid", null: false
t.text "values", null: false
t.index ["account_id", "id"], name: "index_submitters_on_account_id_and_id"
t.index ["completed_at", "account_id"], name: "index_submitters_on_completed_at_and_account_id"
t.index ["email"], name: "index_submitters_on_email"
@ -360,52 +360,52 @@ ActiveRecord::Schema[8.0].define(version: 2025_11_25_194305) do
end
create_table "template_accesses", force: :cascade do |t|
t.bigint "template_id", null: false
t.bigint "user_id", null: false
t.datetime "created_at", null: false
t.bigint "template_id", null: false
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.index ["template_id", "user_id"], name: "index_template_accesses_on_template_id_and_user_id", unique: true
end
create_table "template_folders", force: :cascade do |t|
t.string "name", null: false
t.bigint "author_id", null: false
t.bigint "account_id", null: false
t.datetime "archived_at"
t.bigint "author_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "name", null: false
t.bigint "parent_folder_id"
t.datetime "updated_at", null: false
t.index ["account_id"], name: "index_template_folders_on_account_id"
t.index ["author_id"], name: "index_template_folders_on_author_id"
t.index ["parent_folder_id"], name: "index_template_folders_on_parent_folder_id"
end
create_table "template_sharings", force: :cascade do |t|
t.bigint "template_id", null: false
t.bigint "account_id", null: false
t.string "ability", null: false
t.bigint "account_id", null: false
t.datetime "created_at", null: false
t.bigint "template_id", null: false
t.datetime "updated_at", null: false
t.index ["account_id", "template_id"], name: "index_template_sharings_on_account_id_and_template_id", unique: true
t.index ["template_id"], name: "index_template_sharings_on_template_id"
end
create_table "templates", force: :cascade do |t|
t.string "slug", null: false
t.string "name", null: false
t.text "schema", null: false
t.text "fields", null: false
t.text "submitters", null: false
t.bigint "author_id", null: false
t.bigint "account_id", null: false
t.datetime "archived_at"
t.bigint "author_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.text "source", null: false
t.bigint "folder_id", null: false
t.string "external_id"
t.text "fields", null: false
t.bigint "folder_id", null: false
t.string "name", null: false
t.text "preferences", null: false
t.text "schema", null: false
t.boolean "shared_link", default: false, null: false
t.string "slug", null: false
t.text "source", null: false
t.text "submitters", null: false
t.datetime "updated_at", null: false
t.text "variables_schema"
t.index ["account_id", "folder_id", "id"], name: "index_templates_on_account_id_and_folder_id_and_id", where: "(archived_at IS NULL)"
t.index ["account_id", "id"], name: "index_templates_on_account_id_and_id_archived", where: "(archived_at IS NOT NULL)"
@ -417,44 +417,44 @@ ActiveRecord::Schema[8.0].define(version: 2025_11_25_194305) do
end
create_table "user_configs", force: :cascade do |t|
t.bigint "user_id", null: false
t.string "key", null: false
t.text "value", null: false
t.datetime "created_at", null: false
t.string "key", null: false
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.text "value", null: false
t.index ["user_id", "key"], name: "index_user_configs_on_user_id_and_key", unique: true
t.index ["user_id"], name: "index_user_configs_on_user_id"
end
create_table "users", force: :cascade do |t|
t.string "first_name"
t.string "last_name"
t.string "email", null: false
t.string "role", null: false
t.string "encrypted_password", null: false
t.bigint "account_id", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.datetime "archived_at"
t.datetime "confirmation_sent_at"
t.string "confirmation_token"
t.datetime "confirmed_at"
t.integer "consumed_timestep"
t.datetime "created_at", null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.string "email", null: false
t.string "encrypted_password", null: false
t.integer "failed_attempts", default: 0, null: false
t.string "unlock_token"
t.string "first_name"
t.string "last_name"
t.datetime "last_sign_in_at"
t.string "last_sign_in_ip"
t.datetime "locked_at"
t.datetime "archived_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "uuid", null: false
t.string "otp_secret"
t.integer "consumed_timestep"
t.boolean "otp_required_for_login", default: false, null: false
t.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.string "otp_secret"
t.datetime "remember_created_at"
t.datetime "reset_password_sent_at"
t.string "reset_password_token"
t.string "role", null: false
t.integer "sign_in_count", default: 0, null: false
t.string "unconfirmed_email"
t.string "unlock_token"
t.datetime "updated_at", null: false
t.string "uuid", null: false
t.index ["account_id"], name: "index_users_on_account_id"
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
@ -463,25 +463,25 @@ ActiveRecord::Schema[8.0].define(version: 2025_11_25_194305) do
end
create_table "webhook_attempts", force: :cascade do |t|
t.bigint "webhook_event_id", null: false
t.text "response_body"
t.integer "response_status_code", null: false
t.integer "attempt", null: false
t.datetime "created_at", null: false
t.text "response_body"
t.integer "response_status_code", null: false
t.datetime "updated_at", null: false
t.bigint "webhook_event_id", null: false
t.index ["webhook_event_id"], name: "index_webhook_attempts_on_webhook_event_id"
end
create_table "webhook_events", force: :cascade do |t|
t.string "uuid", null: false
t.bigint "webhook_url_id", null: false
t.bigint "account_id", null: false
t.datetime "created_at", null: false
t.string "event_type", null: false
t.bigint "record_id", null: false
t.string "record_type", null: false
t.string "event_type", null: false
t.string "status", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "uuid", null: false
t.bigint "webhook_url_id", null: false
t.index ["uuid", "webhook_url_id"], name: "index_webhook_events_on_uuid_and_webhook_url_id", unique: true
t.index ["webhook_url_id", "id"], name: "index_webhook_events_error", where: "((status)::text = 'error'::text)"
t.index ["webhook_url_id", "id"], name: "index_webhook_events_on_webhook_url_id_and_id"
@ -489,12 +489,12 @@ ActiveRecord::Schema[8.0].define(version: 2025_11_25_194305) do
create_table "webhook_urls", force: :cascade do |t|
t.bigint "account_id", null: false
t.text "url", null: false
t.datetime "created_at", null: false
t.text "events", null: false
t.text "secret", null: false
t.string "sha1", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.text "secret", null: false
t.text "url", null: false
t.index ["account_id"], name: "index_webhook_urls_on_account_id"
t.index ["sha1"], name: "index_webhook_urls_on_sha1"
end

Loading…
Cancel
Save