initial commit

pull/501/head
Ryan Arakawa 4 months ago
parent 14c84eff93
commit cb81dd170a

@ -325,7 +325,6 @@ GEM
multi_json (1.15.0) multi_json (1.15.0)
multipart-post (2.4.1) multipart-post (2.4.1)
mutex_m (0.3.0) mutex_m (0.3.0)
mysql2 (0.5.6)
net-http-persistent (4.0.5) net-http-persistent (4.0.5)
connection_pool (~> 2.2) connection_pool (~> 2.2)
net-imap (0.5.6) net-imap (0.5.6)
@ -619,7 +618,6 @@ DEPENDENCIES
jwt jwt
letter_opener_web letter_opener_web
lograge lograge
mysql2
oj oj
pagy pagy
pg pg

@ -4,12 +4,12 @@
# #
# Table name: access_tokens # Table name: access_tokens
# #
# id :bigint not null, primary key # id :integer not null, primary key
# sha256 :text not null # sha256 :string not null
# token :text not null # token :text not null
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# user_id :bigint not null # user_id :integer not null
# #
# Indexes # Indexes
# #
@ -18,7 +18,7 @@
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (user_id => users.id) # user_id (user_id => users.id)
# #
class AccessToken < ApplicationRecord class AccessToken < ApplicationRecord
TOKEN_LENGTH = 43 TOKEN_LENGTH = 43

@ -4,7 +4,7 @@
# #
# Table name: accounts # Table name: accounts
# #
# id :bigint not null, primary key # id :integer not null, primary key
# archived_at :datetime # archived_at :datetime
# locale :string not null # locale :string not null
# name :string not null # name :string not null

@ -4,11 +4,11 @@
# #
# Table name: account_accesses # Table name: account_accesses
# #
# id :bigint not null, primary key # id :integer not null, primary key
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# account_id :bigint not null # account_id :integer not null
# user_id :bigint not null # user_id :integer not null
# #
# Indexes # Indexes
# #
@ -16,7 +16,7 @@
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (account_id => accounts.id) # account_id (account_id => accounts.id)
# #
class AccountAccess < ApplicationRecord class AccountAccess < ApplicationRecord
belongs_to :account belongs_to :account

@ -4,12 +4,12 @@
# #
# Table name: account_configs # Table name: account_configs
# #
# id :bigint not null, primary key # id :integer not null, primary key
# key :string not null # key :string not null
# value :text not null # value :text not null
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# account_id :bigint not null # account_id :integer not null
# #
# Indexes # Indexes
# #
@ -18,7 +18,7 @@
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (account_id => accounts.id) # account_id (account_id => accounts.id)
# #
class AccountConfig < ApplicationRecord class AccountConfig < ApplicationRecord
SUBMITTER_INVITATION_EMAIL_KEY = 'submitter_invitation_email' SUBMITTER_INVITATION_EMAIL_KEY = 'submitter_invitation_email'

@ -4,12 +4,12 @@
# #
# Table name: account_linked_accounts # Table name: account_linked_accounts
# #
# id :bigint not null, primary key # id :integer not null, primary key
# account_type :text not null # account_type :text not null
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# account_id :bigint not null # account_id :integer not null
# linked_account_id :bigint not null # linked_account_id :integer not null
# #
# Indexes # Indexes
# #
@ -19,8 +19,8 @@
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (account_id => accounts.id) # account_id (account_id => accounts.id)
# fk_rails_... (linked_account_id => accounts.id) # linked_account_id (linked_account_id => accounts.id)
# #
class AccountLinkedAccount < ApplicationRecord class AccountLinkedAccount < ApplicationRecord
belongs_to :account belongs_to :account

@ -4,7 +4,7 @@
# #
# Table name: completed_documents # Table name: completed_documents
# #
# id :bigint not null, primary key # id :integer not null, primary key
# sha256 :string not null # sha256 :string not null
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null

@ -4,7 +4,7 @@
# #
# Table name: completed_submitters # Table name: completed_submitters
# #
# id :bigint not null, primary key # id :integer not null, primary key
# completed_at :datetime not null # completed_at :datetime not null
# sms_count :integer not null # sms_count :integer not null
# source :string not null # source :string not null

@ -4,20 +4,20 @@
# #
# Table name: document_generation_events # Table name: document_generation_events
# #
# id :bigint not null, primary key # id :integer not null, primary key
# event_name :string not null # event_name :string not null
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# submitter_id :bigint not null # submitter_id :integer not null
# #
# Indexes # Indexes
# #
# index_document_generation_events_on_submitter_id (submitter_id) # 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 IN ('start', 'complete')
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (submitter_id => submitters.id) # submitter_id (submitter_id => submitters.id)
# #
class DocumentGenerationEvent < ApplicationRecord class DocumentGenerationEvent < ApplicationRecord
belongs_to :submitter belongs_to :submitter

@ -4,7 +4,7 @@
# #
# Table name: email_events # Table name: email_events
# #
# id :bigint not null, primary key # id :integer not null, primary key
# data :text not null # data :text not null
# email :string not null # email :string not null
# emailable_type :string not null # emailable_type :string not null
@ -12,21 +12,21 @@
# event_type :string not null # event_type :string not null
# tag :string not null # tag :string not null
# created_at :datetime not null # created_at :datetime not null
# account_id :bigint not null # account_id :integer not null
# emailable_id :bigint not null # emailable_id :integer not null
# message_id :string not null # message_id :string not null
# #
# Indexes # Indexes
# #
# index_email_events_on_account_id_and_event_datetime (account_id,event_datetime) # index_email_events_on_account_id_and_event_datetime (account_id,event_datetime)
# index_email_events_on_email (email) # 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, 'complaint'::character varying, 'soft_complaint'::character varying])::text[])) # index_email_events_on_email_event_types (email) WHERE event_type IN ('bounce', 'soft_bounce', 'complaint', 'soft_complaint')
# index_email_events_on_emailable (emailable_type,emailable_id) # index_email_events_on_emailable (emailable_type,emailable_id)
# index_email_events_on_message_id (message_id) # index_email_events_on_message_id (message_id)
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (account_id => accounts.id) # account_id (account_id => accounts.id)
# #
class EmailEvent < ApplicationRecord class EmailEvent < ApplicationRecord
belongs_to :emailable, polymorphic: true belongs_to :emailable, polymorphic: true

@ -4,15 +4,15 @@
# #
# Table name: email_messages # Table name: email_messages
# #
# id :bigint not null, primary key # id :integer not null, primary key
# body :text not null # body :text not null
# sha1 :string not null # sha1 :string not null
# subject :text not null # subject :text not null
# uuid :string not null # uuid :string not null
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# account_id :bigint not null # account_id :integer not null
# author_id :bigint not null # author_id :integer not null
# #
# Indexes # Indexes
# #
@ -22,8 +22,8 @@
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (account_id => accounts.id) # account_id (account_id => accounts.id)
# fk_rails_... (author_id => users.id) # author_id (author_id => users.id)
# #
class EmailMessage < ApplicationRecord class EmailMessage < ApplicationRecord
belongs_to :author, class_name: 'User' belongs_to :author, class_name: 'User'

@ -4,12 +4,12 @@
# #
# Table name: encrypted_configs # Table name: encrypted_configs
# #
# id :bigint not null, primary key # id :integer not null, primary key
# key :string not null # key :string not null
# value :text not null # value :text not null
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# account_id :bigint not null # account_id :integer not null
# #
# Indexes # Indexes
# #
@ -18,7 +18,7 @@
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (account_id => accounts.id) # account_id (account_id => accounts.id)
# #
class EncryptedConfig < ApplicationRecord class EncryptedConfig < ApplicationRecord
CONFIG_KEYS = [ CONFIG_KEYS = [

@ -4,12 +4,12 @@
# #
# Table name: encrypted_user_configs # Table name: encrypted_user_configs
# #
# id :bigint not null, primary key # id :integer not null, primary key
# key :string not null # key :string not null
# value :text not null # value :text not null
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# user_id :bigint not null # user_id :integer not null
# #
# Indexes # Indexes
# #
@ -18,7 +18,7 @@
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (user_id => users.id) # user_id (user_id => users.id)
# #
class EncryptedUserConfig < ApplicationRecord class EncryptedUserConfig < ApplicationRecord
belongs_to :user belongs_to :user

@ -4,36 +4,36 @@
# #
# Table name: submissions # Table name: submissions
# #
# id :bigint not null, primary key # id :integer not null, primary key
# archived_at :datetime # archived_at :datetime
# expire_at :datetime # expire_at :datetime
# name :text # name :text
# preferences :text not null # preferences :text not null
# slug :string not null # slug :string not null
# source :text not null # source :string not null
# submitters_order :string not null # submitters_order :string not null
# template_fields :text # template_fields :text
# template_schema :text # template_schema :text
# template_submitters :text # template_submitters :text
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# account_id :bigint not null # account_id :integer not null
# created_by_user_id :bigint # created_by_user_id :integer
# template_id :bigint # template_id :integer
# #
# Indexes # Indexes
# #
# index_submissions_on_account_id_and_id (account_id,id) # index_submissions_on_account_id_and_id (account_id,id)
# index_submissions_on_account_id_and_template_id_and_id (account_id,template_id,id) WHERE (archived_at IS NULL) # index_submissions_on_account_id_and_template_id_and_id (account_id,template_id,id) WHERE archived_at IS NULL
# index_submissions_on_account_id_and_template_id_and_id_archived (account_id,template_id,id) WHERE (archived_at IS NOT NULL) # index_submissions_on_account_id_and_template_id_and_id_archived (account_id,template_id,id) WHERE archived_at IS NOT NULL
# index_submissions_on_created_by_user_id (created_by_user_id) # index_submissions_on_created_by_user_id (created_by_user_id)
# index_submissions_on_slug (slug) UNIQUE # index_submissions_on_slug (slug) UNIQUE
# index_submissions_on_template_id (template_id) # index_submissions_on_template_id (template_id)
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (created_by_user_id => users.id) # created_by_user_id (created_by_user_id => users.id)
# fk_rails_... (template_id => templates.id) # template_id (template_id => templates.id)
# #
class Submission < ApplicationRecord class Submission < ApplicationRecord
belongs_to :template, optional: true belongs_to :template, optional: true

@ -4,14 +4,14 @@
# #
# Table name: submission_events # Table name: submission_events
# #
# id :bigint not null, primary key # id :integer not null, primary key
# data :text not null # data :text not null
# event_timestamp :datetime not null # event_timestamp :datetime not null
# event_type :string not null # event_type :string not null
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# submission_id :bigint not null # submission_id :integer not null
# submitter_id :bigint # submitter_id :integer
# #
# Indexes # Indexes
# #
@ -21,8 +21,8 @@
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (submission_id => submissions.id) # submission_id (submission_id => submissions.id)
# fk_rails_... (submitter_id => submitters.id) # submitter_id (submitter_id => submitters.id)
# #
class SubmissionEvent < ApplicationRecord class SubmissionEvent < ApplicationRecord
belongs_to :submission belongs_to :submission

@ -4,7 +4,7 @@
# #
# Table name: submitters # Table name: submitters
# #
# id :bigint not null, primary key # id :integer not null, primary key
# completed_at :datetime # completed_at :datetime
# declined_at :datetime # declined_at :datetime
# email :string # email :string
@ -22,9 +22,9 @@
# values :text not null # values :text not null
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# account_id :bigint not null # account_id :integer not null
# external_id :string # external_id :string
# submission_id :bigint not null # submission_id :integer not null
# #
# Indexes # Indexes
# #
@ -37,7 +37,7 @@
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (submission_id => submissions.id) # submission_id (submission_id => submissions.id)
# #
class Submitter < ApplicationRecord class Submitter < ApplicationRecord
belongs_to :submission belongs_to :submission

@ -4,7 +4,7 @@
# #
# Table name: templates # Table name: templates
# #
# id :bigint not null, primary key # id :integer not null, primary key
# archived_at :datetime # archived_at :datetime
# fields :text not null # fields :text not null
# name :string not null # name :string not null
@ -16,16 +16,16 @@
# submitters :text not null # submitters :text not null
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# account_id :bigint not null # account_id :integer not null
# author_id :bigint not null # author_id :integer not null
# external_id :string # external_id :string
# folder_id :bigint not null # folder_id :integer not null
# #
# Indexes # Indexes
# #
# index_templates_on_account_id (account_id) # index_templates_on_account_id (account_id)
# index_templates_on_account_id_and_folder_id_and_id (account_id,folder_id,id) WHERE (archived_at IS NULL) # index_templates_on_account_id_and_folder_id_and_id (account_id,folder_id,id) WHERE archived_at IS NULL
# index_templates_on_account_id_and_id_archived (account_id,id) WHERE (archived_at IS NOT NULL) # index_templates_on_account_id_and_id_archived (account_id,id) WHERE archived_at IS NOT NULL
# index_templates_on_author_id (author_id) # index_templates_on_author_id (author_id)
# index_templates_on_external_id (external_id) # index_templates_on_external_id (external_id)
# index_templates_on_folder_id (folder_id) # index_templates_on_folder_id (folder_id)
@ -33,9 +33,9 @@
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (account_id => accounts.id) # account_id (account_id => accounts.id)
# fk_rails_... (author_id => users.id) # author_id (author_id => users.id)
# fk_rails_... (folder_id => template_folders.id) # folder_id (folder_id => template_folders.id)
# #
class Template < ApplicationRecord class Template < ApplicationRecord
DEFAULT_SUBMITTER_NAME = 'First Party' DEFAULT_SUBMITTER_NAME = 'First Party'

@ -4,11 +4,11 @@
# #
# Table name: template_accesses # Table name: template_accesses
# #
# id :bigint not null, primary key # id :integer not null, primary key
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# template_id :bigint not null # template_id :integer not null
# user_id :bigint not null # user_id :integer not null
# #
# Indexes # Indexes
# #
@ -16,7 +16,7 @@
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (template_id => templates.id) # template_id (template_id => templates.id)
# #
class TemplateAccess < ApplicationRecord class TemplateAccess < ApplicationRecord
ADMIN_USER_ID = -1 ADMIN_USER_ID = -1

@ -4,13 +4,13 @@
# #
# Table name: template_folders # Table name: template_folders
# #
# id :bigint not null, primary key # id :integer not null, primary key
# archived_at :datetime # archived_at :datetime
# name :string not null # name :string not null
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# account_id :bigint not null # account_id :integer not null
# author_id :bigint not null # author_id :integer not null
# #
# Indexes # Indexes
# #
@ -19,8 +19,8 @@
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (account_id => accounts.id) # account_id (account_id => accounts.id)
# fk_rails_... (author_id => users.id) # author_id (author_id => users.id)
# #
class TemplateFolder < ApplicationRecord class TemplateFolder < ApplicationRecord
DEFAULT_NAME = 'Default' DEFAULT_NAME = 'Default'

@ -4,12 +4,12 @@
# #
# Table name: template_sharings # Table name: template_sharings
# #
# id :bigint not null, primary key # id :integer not null, primary key
# ability :string not null # ability :string not null
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# account_id :bigint not null # account_id :integer not null
# template_id :bigint not null # template_id :integer not null
# #
# Indexes # Indexes
# #
@ -18,7 +18,7 @@
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (template_id => templates.id) # template_id (template_id => templates.id)
# #
class TemplateSharing < ApplicationRecord class TemplateSharing < ApplicationRecord
ALL_ID = -1 ALL_ID = -1

@ -4,7 +4,7 @@
# #
# Table name: users # Table name: users
# #
# id :bigint not null, primary key # id :integer not null, primary key
# archived_at :datetime # archived_at :datetime
# consumed_timestep :integer # consumed_timestep :integer
# current_sign_in_at :datetime # current_sign_in_at :datetime
@ -25,10 +25,10 @@
# role :string not null # role :string not null
# sign_in_count :integer default(0), not null # sign_in_count :integer default(0), not null
# unlock_token :string # unlock_token :string
# uuid :text not null # uuid :string not null
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# account_id :bigint not null # account_id :integer not null
# #
# Indexes # Indexes
# #
@ -40,7 +40,7 @@
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (account_id => accounts.id) # account_id (account_id => accounts.id)
# #
class User < ApplicationRecord class User < ApplicationRecord
ROLES = [ ROLES = [

@ -4,12 +4,12 @@
# #
# Table name: user_configs # Table name: user_configs
# #
# id :bigint not null, primary key # id :integer not null, primary key
# key :string not null # key :string not null
# value :text not null # value :text not null
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# user_id :bigint not null # user_id :integer not null
# #
# Indexes # Indexes
# #
@ -18,7 +18,7 @@
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (user_id => users.id) # user_id (user_id => users.id)
# #
class UserConfig < ApplicationRecord class UserConfig < ApplicationRecord
SIGNATURE_KEY = 'signature' SIGNATURE_KEY = 'signature'

@ -4,14 +4,14 @@
# #
# Table name: webhook_urls # Table name: webhook_urls
# #
# id :bigint not null, primary key # id :integer not null, primary key
# events :text not null # events :text not null
# secret :text not null # secret :text not null
# sha1 :string not null # sha1 :string not null
# url :text not null # url :text not null
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# account_id :bigint not null # account_id :integer not null
# #
# Indexes # Indexes
# #
@ -20,7 +20,7 @@
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (account_id => accounts.id) # account_id (account_id => accounts.id)
# #
class WebhookUrl < ApplicationRecord class WebhookUrl < ApplicationRecord
EVENTS = %w[ EVENTS = %w[

@ -11,14 +11,10 @@
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
# These are extensions that must be enabled in order to support this database
enable_extension "btree_gin"
enable_extension "plpgsql"
create_table "access_tokens", force: :cascade do |t| create_table "access_tokens", force: :cascade do |t|
t.bigint "user_id", null: false t.integer "user_id", null: false
t.text "token", null: false t.text "token", null: false
t.text "sha256", null: false t.string "sha256", null: false
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.index ["sha256"], name: "index_access_tokens_on_sha256", unique: true t.index ["sha256"], name: "index_access_tokens_on_sha256", unique: true
@ -26,15 +22,15 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
end end
create_table "account_accesses", force: :cascade do |t| create_table "account_accesses", force: :cascade do |t|
t.bigint "account_id", null: false t.integer "account_id", null: false
t.bigint "user_id", null: false t.integer "user_id", null: false
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.index ["account_id", "user_id"], name: "index_account_accesses_on_account_id_and_user_id", unique: true t.index ["account_id", "user_id"], name: "index_account_accesses_on_account_id_and_user_id", unique: true
end end
create_table "account_configs", force: :cascade do |t| create_table "account_configs", force: :cascade do |t|
t.bigint "account_id", null: false t.integer "account_id", null: false
t.string "key", null: false t.string "key", null: false
t.text "value", null: false t.text "value", null: false
t.datetime "created_at", null: false t.datetime "created_at", null: false
@ -44,8 +40,8 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
end end
create_table "account_linked_accounts", force: :cascade do |t| create_table "account_linked_accounts", force: :cascade do |t|
t.bigint "account_id", null: false t.integer "account_id", null: false
t.bigint "linked_account_id", null: false t.integer "linked_account_id", null: false
t.text "account_type", null: false t.text "account_type", null: false
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
@ -123,8 +119,8 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
create_table "console1984_commands", force: :cascade do |t| create_table "console1984_commands", force: :cascade do |t|
t.text "statements" t.text "statements"
t.bigint "sensitive_access_id" t.integer "sensitive_access_id"
t.bigint "session_id", null: false t.integer "session_id", null: false
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.index ["sensitive_access_id"], name: "index_console1984_commands_on_sensitive_access_id" t.index ["sensitive_access_id"], name: "index_console1984_commands_on_sensitive_access_id"
@ -133,7 +129,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
create_table "console1984_sensitive_accesses", force: :cascade do |t| create_table "console1984_sensitive_accesses", force: :cascade do |t|
t.text "justification" t.text "justification"
t.bigint "session_id", null: false t.integer "session_id", null: false
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.index ["session_id"], name: "index_console1984_sensitive_accesses_on_session_id" t.index ["session_id"], name: "index_console1984_sensitive_accesses_on_session_id"
@ -141,7 +137,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
create_table "console1984_sessions", force: :cascade do |t| create_table "console1984_sessions", force: :cascade do |t|
t.text "reason" t.text "reason"
t.bigint "user_id", null: false t.integer "user_id", null: false
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.index ["created_at"], name: "index_console1984_sessions_on_created_at" t.index ["created_at"], name: "index_console1984_sessions_on_created_at"
@ -156,18 +152,18 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
end end
create_table "document_generation_events", force: :cascade do |t| create_table "document_generation_events", force: :cascade do |t|
t.bigint "submitter_id", null: false t.integer "submitter_id", null: false
t.string "event_name", null: false t.string "event_name", null: false
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", 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 IN ('start', 'complete')"
t.index ["submitter_id"], name: "index_document_generation_events_on_submitter_id" t.index ["submitter_id"], name: "index_document_generation_events_on_submitter_id"
end end
create_table "email_events", force: :cascade do |t| create_table "email_events", force: :cascade do |t|
t.bigint "account_id", null: false t.integer "account_id", null: false
t.string "emailable_type", null: false t.string "emailable_type", null: false
t.bigint "emailable_id", null: false t.integer "emailable_id", null: false
t.string "message_id", null: false t.string "message_id", null: false
t.string "tag", null: false t.string "tag", null: false
t.string "event_type", null: false t.string "event_type", null: false
@ -177,15 +173,15 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
t.datetime "created_at", 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 ["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"
t.index ["email"], name: "index_email_events_on_email_event_types", where: "((event_type)::text = ANY ((ARRAY['bounce'::character varying, 'soft_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 IN ('bounce', 'soft_bounce', 'complaint', 'soft_complaint')"
t.index ["emailable_type", "emailable_id"], name: "index_email_events_on_emailable" t.index ["emailable_type", "emailable_id"], name: "index_email_events_on_emailable"
t.index ["message_id"], name: "index_email_events_on_message_id" t.index ["message_id"], name: "index_email_events_on_message_id"
end end
create_table "email_messages", force: :cascade do |t| create_table "email_messages", force: :cascade do |t|
t.string "uuid", null: false t.string "uuid", null: false
t.bigint "author_id", null: false t.integer "author_id", null: false
t.bigint "account_id", null: false t.integer "account_id", null: false
t.text "subject", null: false t.text "subject", null: false
t.text "body", null: false t.text "body", null: false
t.string "sha1", null: false t.string "sha1", null: false
@ -197,7 +193,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
end end
create_table "encrypted_configs", force: :cascade do |t| create_table "encrypted_configs", force: :cascade do |t|
t.bigint "account_id", null: false t.integer "account_id", null: false
t.string "key", null: false t.string "key", null: false
t.text "value", null: false t.text "value", null: false
t.datetime "created_at", null: false t.datetime "created_at", null: false
@ -207,7 +203,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
end end
create_table "encrypted_user_configs", force: :cascade do |t| create_table "encrypted_user_configs", force: :cascade do |t|
t.bigint "user_id", null: false t.integer "user_id", null: false
t.string "key", null: false t.string "key", null: false
t.text "value", null: false t.text "value", null: false
t.datetime "created_at", null: false t.datetime "created_at", null: false
@ -217,8 +213,8 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
end end
create_table "oauth_access_grants", force: :cascade do |t| create_table "oauth_access_grants", force: :cascade do |t|
t.bigint "resource_owner_id", null: false t.integer "resource_owner_id", null: false
t.bigint "application_id", null: false t.integer "application_id", null: false
t.string "token", null: false t.string "token", null: false
t.integer "expires_in", null: false t.integer "expires_in", null: false
t.text "redirect_uri", null: false t.text "redirect_uri", null: false
@ -231,8 +227,8 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
end end
create_table "oauth_access_tokens", force: :cascade do |t| create_table "oauth_access_tokens", force: :cascade do |t|
t.bigint "resource_owner_id" t.integer "resource_owner_id"
t.bigint "application_id", null: false t.integer "application_id", null: false
t.string "token", null: false t.string "token", null: false
t.string "refresh_token" t.string "refresh_token"
t.integer "expires_in" t.integer "expires_in"
@ -258,26 +254,9 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
t.index ["uid"], name: "index_oauth_applications_on_uid", unique: true t.index ["uid"], name: "index_oauth_applications_on_uid", unique: true
end 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.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
t.index ["account_id", "tsvector"], name: "index_search_entries_on_account_id_tsvector_submission", where: "((record_type)::text = 'Submission'::text)", using: :gin
t.index ["account_id", "tsvector"], name: "index_search_entries_on_account_id_tsvector_submitter", where: "((record_type)::text = 'Submitter'::text)", using: :gin
t.index ["account_id", "tsvector"], name: "index_search_entries_on_account_id_tsvector_template", where: "((record_type)::text = 'Template'::text)", using: :gin
t.index ["record_id", "record_type"], name: "index_search_entries_on_record_id_and_record_type", unique: true
end
create_table "submission_events", force: :cascade do |t| create_table "submission_events", force: :cascade do |t|
t.bigint "submission_id", null: false t.integer "submission_id", null: false
t.bigint "submitter_id" t.integer "submitter_id"
t.text "data", null: false t.text "data", null: false
t.string "event_type", null: false t.string "event_type", null: false
t.datetime "event_timestamp", null: false t.datetime "event_timestamp", null: false
@ -289,8 +268,8 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
end end
create_table "submissions", force: :cascade do |t| create_table "submissions", force: :cascade do |t|
t.bigint "template_id" t.integer "template_id"
t.bigint "created_by_user_id" t.integer "created_by_user_id"
t.datetime "archived_at" t.datetime "archived_at"
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
@ -301,19 +280,19 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
t.string "submitters_order", null: false t.string "submitters_order", null: false
t.string "slug", null: false t.string "slug", null: false
t.text "preferences", null: false t.text "preferences", null: false
t.bigint "account_id", null: false t.integer "account_id", null: false
t.datetime "expire_at" t.datetime "expire_at"
t.text "name" t.text "name"
t.index ["account_id", "id"], name: "index_submissions_on_account_id_and_id" 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", 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)" 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"
t.index ["created_by_user_id"], name: "index_submissions_on_created_by_user_id" t.index ["created_by_user_id"], name: "index_submissions_on_created_by_user_id"
t.index ["slug"], name: "index_submissions_on_slug", unique: true t.index ["slug"], name: "index_submissions_on_slug", unique: true
t.index ["template_id"], name: "index_submissions_on_template_id" t.index ["template_id"], name: "index_submissions_on_template_id"
end end
create_table "submitters", force: :cascade do |t| create_table "submitters", force: :cascade do |t|
t.bigint "submission_id", null: false t.integer "submission_id", null: false
t.string "uuid", null: false t.string "uuid", null: false
t.string "email" t.string "email"
t.string "slug", null: false t.string "slug", null: false
@ -330,7 +309,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
t.string "external_id" t.string "external_id"
t.text "preferences", null: false t.text "preferences", null: false
t.text "metadata", null: false t.text "metadata", null: false
t.bigint "account_id", null: false t.integer "account_id", null: false
t.datetime "declined_at" t.datetime "declined_at"
t.string "timezone" t.string "timezone"
t.index ["account_id", "id"], name: "index_submitters_on_account_id_and_id" t.index ["account_id", "id"], name: "index_submitters_on_account_id_and_id"
@ -342,8 +321,8 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
end end
create_table "template_accesses", force: :cascade do |t| create_table "template_accesses", force: :cascade do |t|
t.bigint "template_id", null: false t.integer "template_id", null: false
t.bigint "user_id", null: false t.integer "user_id", null: false
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.index ["template_id", "user_id"], name: "index_template_accesses_on_template_id_and_user_id", unique: true t.index ["template_id", "user_id"], name: "index_template_accesses_on_template_id_and_user_id", unique: true
@ -351,8 +330,8 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
create_table "template_folders", force: :cascade do |t| create_table "template_folders", force: :cascade do |t|
t.string "name", null: false t.string "name", null: false
t.bigint "author_id", null: false t.integer "author_id", null: false
t.bigint "account_id", null: false t.integer "account_id", null: false
t.datetime "archived_at" t.datetime "archived_at"
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
@ -361,8 +340,8 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
end end
create_table "template_sharings", force: :cascade do |t| create_table "template_sharings", force: :cascade do |t|
t.bigint "template_id", null: false t.integer "template_id", null: false
t.bigint "account_id", null: false t.integer "account_id", null: false
t.string "ability", null: false t.string "ability", null: false
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
@ -376,18 +355,18 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
t.text "schema", null: false t.text "schema", null: false
t.text "fields", null: false t.text "fields", null: false
t.text "submitters", null: false t.text "submitters", null: false
t.bigint "author_id", null: false t.integer "author_id", null: false
t.bigint "account_id", null: false t.integer "account_id", null: false
t.datetime "archived_at" t.datetime "archived_at"
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.text "source", null: false t.text "source", null: false
t.bigint "folder_id", null: false t.integer "folder_id", null: false
t.string "external_id" t.string "external_id"
t.text "preferences", null: false t.text "preferences", null: false
t.boolean "shared_link", default: false, null: false t.boolean "shared_link", default: false, null: false
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", "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)" t.index ["account_id", "id"], name: "index_templates_on_account_id_and_id_archived", where: "archived_at IS NOT NULL"
t.index ["account_id"], name: "index_templates_on_account_id" t.index ["account_id"], name: "index_templates_on_account_id"
t.index ["author_id"], name: "index_templates_on_author_id" t.index ["author_id"], name: "index_templates_on_author_id"
t.index ["external_id"], name: "index_templates_on_external_id" t.index ["external_id"], name: "index_templates_on_external_id"
@ -396,7 +375,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
end end
create_table "user_configs", force: :cascade do |t| create_table "user_configs", force: :cascade do |t|
t.bigint "user_id", null: false t.integer "user_id", null: false
t.string "key", null: false t.string "key", null: false
t.text "value", null: false t.text "value", null: false
t.datetime "created_at", null: false t.datetime "created_at", null: false
@ -411,7 +390,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
t.string "email", null: false t.string "email", null: false
t.string "role", null: false t.string "role", null: false
t.string "encrypted_password", null: false t.string "encrypted_password", null: false
t.bigint "account_id", null: false t.integer "account_id", null: false
t.string "reset_password_token" t.string "reset_password_token"
t.datetime "reset_password_sent_at" t.datetime "reset_password_sent_at"
t.datetime "remember_created_at" t.datetime "remember_created_at"
@ -438,7 +417,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_18_085322) do
end end
create_table "webhook_urls", force: :cascade do |t| create_table "webhook_urls", force: :cascade do |t|
t.bigint "account_id", null: false t.integer "account_id", null: false
t.text "url", null: false t.text "url", null: false
t.text "events", null: false t.text "events", null: false
t.string "sha1", null: false t.string "sha1", null: false

Loading…
Cancel
Save