index int64 0 0 | repo_id stringclasses 829
values | file_path stringlengths 34 254 | content stringlengths 6 5.38M |
|---|---|---|---|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20250428154055_create_sign_in_certificates.rb | class CreateSignInCertificates < ActiveRecord::Migration[7.2]
def change
create_table :sign_in_certificates, id: :uuid do |t|
t.text :pem, null: false
t.timestamps
end
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240501164740_attempt_may1_remove_address_details_from_vye_user_infos.vye.rb | # This migration comes from vye (originally 20240501000101)
class AttemptMay1RemoveAddressDetailsFromVyeUserInfos < ActiveRecord::Migration[7.0]
def change
safety_assured do
remove_column :vye_user_infos, :full_name_ciphertext, :text if column_exists?(:vye_user_infos, :full_name_ciphertext)
remove_col... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240213175114_add_shared_sessions_to_client_config.rb | class AddSharedSessionsToClientConfig < ActiveRecord::Migration[7.0]
def change
safety_assured { add_column :client_configs, :shared_sessions, :boolean, default: false, null: false }
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20251107143043_drop_webhooks.rb | class DropWebhooks < ActiveRecord::Migration[7.2]
disable_ddl_transaction!
def up
drop_table :webhooks_subscriptions, if_exists: true
drop_table :webhooks_notifications, if_exists: true
drop_table :webhooks_notification_attempts, if_exists: true
drop_table :webhooks_notification_attempt_assocs, if_... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20250211192052_add_event_type_to_user_action_events.rb | # frozen_string_literal: true
class AddEventTypeToUserActionEvents < ActiveRecord::Migration[7.2]
def change
add_column :user_action_events, :event_id, :string
add_column :user_action_events, :event_type, :integer
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240501164745_attempt_may1_remove_from_vye_pending_document.vye.rb | # This migration comes from vye (originally 20240501000106)
class AttemptMay1RemoveFromVyePendingDocument < ActiveRecord::Migration[7.1]
def change
safety_assured do
remove_column :vye_pending_documents, :encrypted_kms_key, :text if column_exists?(:vye_pending_documents, :encrypted_kms_key)
end
end
en... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20220510182554_add_user_verification__credential_email_to_oauth_sessions.rb | class AddUserVerificationCredentialEmailToOAuthSessions < ActiveRecord::Migration[6.1]
def change
safety_assured do
add_reference :oauth_sessions, :user_verification, foreign_key: :true, null: true, index: true
end
add_column :oauth_sessions, :credential_email, :string
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240508190041_add_submit_endpoint_to_form526_submissions.rb | class AddSubmitEndpointToForm526Submissions < ActiveRecord::Migration[7.1]
def change
add_column :form526_submissions, :submit_endpoint, :integer
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240425231538_remove_verifications.vye.rb | class RemoveVerifications < ActiveRecord::Migration[7.1]
def change
remove_index "vye_verifications", column: [:user_profile_id], name: "index_vye_verifications_on_user_profile_id", if_exists: true
safety_assured { remove_column :vye_verifications, :user_profile_id, :integer, if_exists: true }
safety_ass... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20231018191445_update_staging_postgis.rb | class UpdateStagingPostgis < ActiveRecord::Migration[6.1]
def up
if Settings.vsp_enviroment == "staging"
connection.execute("SELECT postgis_extensions_upgrade();")
connection.execute("SELECT postgis_extensions_upgrade();")
end
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20250312085126_create_bpds_submission_attempts.rb | class CreateBPDSSubmissionAttempts < ActiveRecord::Migration[7.2]
def change
create_table :bpds_submission_attempts do |t|
t.timestamps
t.references :bpds_submission, null: false, foreign_key: true
t.enum :status, enum_type: 'bpds_submission_status', default: 'pending'
t.jsonb :metadata_ci... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20241008231122_add_column_failure_notification_sent_at_to_appeal_submission_and_upload.rb | class AddColumnFailureNotificationSentAtToAppealSubmissionAndUpload < ActiveRecord::Migration[7.1]
def change
# appeal_submissions
add_column :appeal_submissions, :failure_notification_sent_at, :datetime
# appeal_submission_uploads
add_column :appeal_submission_uploads, :failure_notification_sent... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20221017192638_add_code_detail_to_appeals_api_status_updates.rb | class AddCodeDetailToAppealsApiStatusUpdates < ActiveRecord::Migration[6.1]
def change
add_column :appeals_api_status_updates, :code, :string
add_column :appeals_api_status_updates, :detail, :string
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20210325230116_add_expanded_covid_registration.rb | class AddExpandedCovidRegistration < ActiveRecord::Migration[6.0]
def change
create_table :covid_vaccine_expanded_registration_submissions, id: :serial do |t|
t.string "submission_uuid", null: false
t.string "vetext_sid"
t.boolean "sequestered", default: true, null: false
t.string "state"
... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20221118232353_add_user_accountto_appeal_submissions.rb | class AddUserAccounttoAppealSubmissions < ActiveRecord::Migration[6.1]
def change
safety_assured do
add_reference :appeal_submissions, :user_account, type: :uuid, foreign_key: true, null: true, index: true
end
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20210106135429_create_education_stem_automated_decisions.rb | class CreateEducationStemAutomatedDecisions < ActiveRecord::Migration[6.0]
def change
create_table :education_stem_automated_decisions do |t|
t.bigint "education_benefits_claim_id"
t.string "automated_decision_state", default: 'init'
t.string "user_uuid", null: false
t.timestamps(null: fal... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20230705144658_create_vba_documents_monthly_stats.rb | class CreateVBADocumentsMonthlyStats < ActiveRecord::Migration[6.1]
def change
create_table :vba_documents_monthly_stats do |t|
t.integer :month, null: false
t.integer :year, null: false
t.jsonb :stats, default: {}
t.timestamps
t.index %i[ month year ], name: "index_vba_documents_m... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20241016170022_add_index_to_appeal_submission_uploads.rb | class AddIndexToAppealSubmissionUploads < ActiveRecord::Migration[7.1]
disable_ddl_transaction!
def change
add_index :appeal_submission_uploads, :appeal_submission_id, algorithm: :concurrently
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20241017154903_create_claim_va_notifications.rb | class CreateClaimVANotifications < ActiveRecord::Migration[7.1]
def change
create_table :claim_va_notifications do |t|
t.string :form_type
t.references :saved_claim, null: false, foreign_key: true
t.boolean :email_sent
t.integer :email_template_id
t.timestamps
end
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20250523203440_add_unique_index_to_gibs_not_found_users_edipi.rb | class AddUniqueIndexToGibsNotFoundUsersEdipi < ActiveRecord::Migration[7.2]
disable_ddl_transaction!
def change
remove_index :gibs_not_found_users, column: :edipi, algorithm: :concurrently
add_index :gibs_not_found_users, :edipi, unique: true, algorithm: :concurrently, name: :index_gibs_not_found_users_on_... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20250523210208_add_unique_index_to_banners_entity_id.rb | class AddUniqueIndexToBannersEntityId < ActiveRecord::Migration[7.2]
disable_ddl_transaction!
def change
remove_index :banners, :entity_id, algorithm: :concurrently
add_index :banners, :entity_id, unique: true, algorithm: :concurrently
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20201207173935_add_carma_case_id_index_to_form1010cg_submissions.rb | class AddCARMACaseIdIndexToForm1010cgSubmissions < ActiveRecord::Migration[6.0]
disable_ddl_transaction!
def change
add_index :form1010cg_submissions, :carma_case_id, unique: true, algorithm: :concurrently
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240212184756_add_column_flagged_value_updated_at_and_new_unique_constraint.rb | class AddColumnFlaggedValueUpdatedAtAndNewUniqueConstraint < ActiveRecord::Migration[7.0]
disable_ddl_transaction!
def change
add_column :flagged_veteran_representative_contact_data, :flagged_value_updated_at, :datetime, null: true
add_index :flagged_veteran_representative_contact_data, [:ip_address, :repr... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240723142201_add_tracked_items_to_ews.rb | class AddTrackedItemsToEws < ActiveRecord::Migration[7.1]
def change
add_column :claims_api_evidence_waiver_submissions, :tracked_items, :integer, default: [], array: true
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20220912152647_create_virtual_agent_user_access_records.rb | class CreateVirtualAgentUserAccessRecords < ActiveRecord::Migration[6.1]
def change
create_table :virtual_agent_user_access_records do |t|
t.string :action_type, null: false
t.string :first_name
t.string :last_name
t.string :ssn, null: false
t.string :icn, null: false
t.index ... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20230112221719_create_user_credential_email.rb | class CreateUserCredentialEmail < ActiveRecord::Migration[6.1]
def change
create_table :user_credential_emails do |t|
t.references :user_verification, foreign_key: true, index: { unique: true }
t.text :credential_email_ciphertext
t.text :encrypted_kms_key
t.timestamps
end
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20241018163939_create_secondary_appeal_form.rb | class CreateSecondaryAppealForm < ActiveRecord::Migration[7.1]
def change
create_table :secondary_appeal_forms do |t|
t.string :form_id
t.text :encrypted_kms_key
t.text :form_ciphertext
t.uuid :guid
t.string :status
t.datetime :status_updated_at
t.references :appeal_submi... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20231215141612_create_vye_user_infos.vye.rb | # frozen_string_literal: true
# This migration comes from vye (originally 20231120034639)
class CreateVyeUserInfos < ActiveRecord::Migration[6.1]
def change
create_table :vye_user_infos do |t|
t.string :icn
t.string :ssn_digest
t.text :ssn_ciphertext
t.text :file_number_ciphertext
t... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20210331131560_add_index_to_health_quest_questionnaire_responses_encrypted_questionnaire_response_data_iv.health_quest.rb | class AddIndexToHealthQuestQuestionnaireResponsesEncryptedQuestionnaireResponseDataIv < ActiveRecord::Migration[6.0]
disable_ddl_transaction!
def change
add_index :health_quest_questionnaire_responses, :encrypted_questionnaire_response_data_iv, unique: true, algorithm: :concurrently, name: 'qr_key'
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20241216175516_add_user_account_to_saved_claims.rb | class AddUserAccountToSavedClaims < ActiveRecord::Migration[7.2]
disable_ddl_transaction!
def change
add_reference :saved_claims, :user_account, null: true, index: {algorithm: :concurrently}
end
end |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20220427215503_create_veteran_device_record.rb | class CreateVeteranDeviceRecord < ActiveRecord::Migration[6.1]
def change
create_table :veteran_device_records do |t|
t.references :device, null: false, foreign_key: true
t.boolean :active, null: false, default: true
t.string :icn, null: false
t.timestamps
end
add_index :veteran_d... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20210429131042_notice_of_disagreement.rb | # frozen_string_literal: true
class NoticeOfDisagreement < ActiveRecord::Migration[6.0]
def change
# column is not yet used so it's safe to rename
safety_assured { remove_column :appeal_submissions, :board_review_otpion, :string }
add_column :appeal_submissions, :board_review_option, :string
add_colu... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240425231104_add_ssn_and_icen_from_vye_tables.vye.rb | class AddSsnAndIcenFromVyeTables < ActiveRecord::Migration[7.1]
def change
add_column :vye_user_infos, :icn, :string, if_not_exists: true
add_column :vye_user_infos, :ssn_ciphertext, :text, if_not_exists: true
add_column :vye_user_infos, :ssn_digest, :string, if_not_exists: true
add_column :vye_pendin... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20220426212418_create_device.rb | class CreateDevice < ActiveRecord::Migration[6.1]
def change
create_table :devices do |t|
t.string :key
t.string :name
t.timestamps
end
add_index :devices, :key, unique: true
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20241231213045_drop_va_forms_forms.rb | class DropVAFormsForms < ActiveRecord::Migration[7.2]
def change
drop_table :va_forms_forms, if_exists: true
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20250117180319_create_user_actions.rb | # frozen_string_literal: true
class CreateUserActions < ActiveRecord::Migration[7.2]
def change
create_enum :user_action_status, %w[initial success error]
create_table :user_actions, id: :uuid do |t|
t.references :acting_user_account, null: false, foreign_key: { to_table: :user_accounts }, type: :uuid
... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240606194938_create_intent_to_file_queue_exhaustions.rb | class CreateIntentToFileQueueExhaustions < ActiveRecord::Migration[7.1]
def change
create_table :intent_to_file_queue_exhaustions do |t|
t.string :veteran_icn
t.string :form_type
t.datetime :form_start_date
t.timestamps
end
add_index :intent_to_file_queue_exhaustions, :veteran_icn... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20221122004441_add_user_account_to_mhv_accounts.rb | class AddUserAccountToMHVAccounts < ActiveRecord::Migration[6.1]
def change
safety_assured do
add_reference :mhv_accounts, :user_account, type: :uuid, foreign_key: true, null: true, index: true
end
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20230616145330_create_claims_api_claim_submissions.rb | class CreateClaimsApiClaimSubmissions < ActiveRecord::Migration[6.1]
def change
create_table :claims_api_claim_submissions do |t|
t.references :claim, type: :uuid, null: false, index: true, foreign_key: { to_table: :claims_api_auto_established_claims }
t.string :claim_type, null: false
t.string ... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20250819181708_add_attempts_to_event_bus_gateway_notifications.rb | class AddAttemptsToEventBusGatewayNotifications < ActiveRecord::Migration[7.2]
def change
add_column :event_bus_gateway_notifications, :attempts, :integer
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20211220222016_delete_and_recreate_userverifications_useraccounts_deprecateduseraccounts.rb | class DeleteAndRecreateUserverificationsUseraccountsDeprecateduseraccounts < ActiveRecord::Migration[6.1]
disable_ddl_transaction!
def up
drop_user_tables
create_user_tables
end
def down
drop_user_tables
create_user_tables
end
private
def drop_user_tables
drop_table :deprecated_use... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20250911084822_create_saved_claim_group_status_enum.rb | # frozen_string_literal: true
class CreateSavedClaimGroupStatusEnum < ActiveRecord::Migration[7.2]
def change
create_enum :saved_claim_group_status, %w[pending accepted failure processing success]
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20230509181327_create_income_limits_tables.rb | class CreateIncomeLimitsTables < ActiveRecord::Migration[6.1]
def change
create_table :std_counties do |t|
t.string :name, null: false
t.integer :county_number, null: false
t.string :description, null: false
t.integer :state_id, null: false
t.integer :version, null: false
t.dat... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20241112135704_drop_benefits_intake_uuid_from_form_submissions.rb | class DropBenefitsIntakeUuidFromFormSubmissions < ActiveRecord::Migration[7.1]
def change
safety_assured { remove_column :form_submissions, :benefits_intake_uuid, :uuid, if_exists: true }
end
end |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240226235237_create_schema_contract_validations.rb | class CreateSchemaContractValidations < ActiveRecord::Migration[7.0]
def change
create_table :schema_contract_validations do |t|
t.string :contract_name, null: false
t.string :user_uuid, null: false
t.jsonb :response, null: false
t.integer :status, null: false
t.string :error_details... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20210223132223_add_remaining_entitlement_to_education_stem_automated_decisions.rb | class AddRemainingEntitlementToEducationStemAutomatedDecisions < ActiveRecord::Migration[6.0]
def change
add_column :education_stem_automated_decisions, :remaining_entitlement, :integer
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20250708104133_add_indexes_to_digital_dispute_submissions.rb | # frozen_string_literal: true
class AddIndexesToDigitalDisputeSubmissions < ActiveRecord::Migration[7.2]
disable_ddl_transaction!
def change
add_index :digital_dispute_submissions, :user_uuid, algorithm: :concurrently
add_index :digital_dispute_submissions, :needs_kms_rotation, algorithm: :concurrently
... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240502151751_drop_vba_documents_git_items.rb | class DropVBADocumentsGitItems < ActiveRecord::Migration[7.1]
def change
drop_table :vba_documents_git_items, if_exists: true
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240819184218_drop_accredited_representative_portal_pilot_representatives.rb | class DropAccreditedRepresentativePortalPilotRepresentatives < ActiveRecord::Migration[6.0]
def up
drop_table :accredited_representative_portal_pilot_representatives, if_exists: true
end
def down
raise ActiveRecord::IrreversibleMigration
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240229150823_add_state_to_form_526_submissions.rb | class AddStateToForm526Submissions < ActiveRecord::Migration[7.0]
def change
add_column :form526_submissions, :aasm_state, :string
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20220913100825_add_backing_idme_uuid_to_user_verification.rb | class AddBackingIdmeUuidToUserVerification < ActiveRecord::Migration[6.1]
disable_ddl_transaction!
def change
add_column :user_verifications, :backing_idme_uuid, :string
add_index :user_verifications, :backing_idme_uuid, algorithm: :concurrently
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20210412161757_create_git_items.rb | class CreateGitItems < ActiveRecord::Migration[6.0]
def change
create_table :vba_documents_git_items do |t|
t.string :url, null: false
t.jsonb :git_item
t.boolean :notified, default: false
t.string :label
t.timestamps
end
add_index :vba_documents_git_items, :url, unique: true... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20250605180405_add_user_account_to_tud_accounts.rb | class AddUserAccountToTudAccounts < ActiveRecord::Migration[7.2]
def change
safety_assured do
add_reference :test_user_dashboard_tud_accounts, :user_account, type: :uuid, foreign_key: true, null: true
add_reference :test_user_dashboard_tud_account_availability_logs, :user_account, type: :uuid, foreign... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20230228223626_remove_virtual_agent_user_access_record.rb | class RemoveVirtualAgentUserAccessRecord < ActiveRecord::Migration[6.1]
def up
drop_table :virtual_agent_user_access_records
end
def down
raise ActiveRecord::IrreversibleMigration
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20210504163547_pghero_query_stats.rb | class PgheroQueryStats < ActiveRecord::Migration[6.0]
def change
create_table "pghero_query_stats" do |t|
t.text "database"
t.text "user"
t.text "query"
t.bigint "query_hash"
t.float "total_time"
t.bigint "calls"
t.datetime "captured_at"
t.index ["database", "captur... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240713000047_drop_decision_review_evidence_attachment_validation.rb | class DropDecisionReviewEvidenceAttachmentValidation < ActiveRecord::Migration[7.1]
def change
remove_index :decision_review_evidence_attachment_validations, column: :decision_review_evidence_attachment_guid, name: "index_dr_evidence_attachment_validation_on_guid"
drop_table :decision_review_evidence_attachme... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20220104185549_create_pghero_space_stats.rb | class CreatePgheroSpaceStats < ActiveRecord::Migration[6.1]
def change
create_table :pghero_space_stats do |t|
t.text :database
t.text :schema
t.text :relation
t.integer :size, limit: 8
t.timestamp :captured_at
end
add_index :pghero_space_stats, [:database, :captured_at]
e... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20230512221434_add_certificates_client_configs.rb | class AddCertificatesClientConfigs < ActiveRecord::Migration[6.1]
def change
add_column :client_configs, :certificates, :string, array: true
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20231024160958_add_address_to_veteran_organizations.rb | class AddAddressToVeteranOrganizations < ActiveRecord::Migration[6.1]
def change
add_column :veteran_organizations, :address_line_1, :string
add_column :veteran_organizations, :address_line_2, :string
add_column :veteran_organizations, :address_line_3, :string
add_column :veteran_organizations, :addre... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20211203132446_add_decrypt_verification_date_to_tables_with_encrypted_attrs.rb | class AddDecryptVerificationDateToTablesWithEncryptedAttrs < ActiveRecord::Migration[6.1]
def change
# appeal_submissions
add_column :appeal_submissions, :verified_decryptable_at, :date
# appeals_api_evidence_submissions
add_column :appeals_api_evidence_submissions, :verified_decryptable_at, :date
... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20241021152303_add_status_to_intent_to_file_queue_exhaustion.rb | class AddStatusToIntentToFileQueueExhaustion < ActiveRecord::Migration[7.1]
def change
create_enum :itf_remediation_status, %w[unprocessed]
add_column :intent_to_file_queue_exhaustions, :status, :enum, enum_type: 'itf_remediation_status', default: 'unprocessed'
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240625180946_add_backup_submitted_claim_status_to_form526_submission.rb | class AddBackupSubmittedClaimStatusToForm526Submission < ActiveRecord::Migration[7.1]
def change
add_column :form526_submissions, :backup_submitted_claim_status, :integer
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240319141429_add_ipf_data_to_form5655_submission.rb | class AddIpfDataToForm5655Submission < ActiveRecord::Migration[7.1]
def change
add_column :form5655_submissions, :ipf_data_ciphertext, :text
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20211101233443_remove_uniqueness_constraint_user_verifications_user_account.rb | class RemoveUniquenessConstraintUserVerificationsUserAccount < ActiveRecord::Migration[6.1]
disable_ddl_transaction!
def change
remove_index :user_verifications, :user_account_id
add_index :user_verifications, :user_account_id, algorithm: :concurrently
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20241016172752_add_upload_submission_status_created_at_index.rb | class AddUploadSubmissionStatusCreatedAtIndex < ActiveRecord::Migration[7.1]
disable_ddl_transaction!
def change
add_index :vba_documents_upload_submissions, [:status, :created_at], name: 'index_vba_docs_upload_submissions_status_created_at_false', where: "s3_deleted IS FALSE", algorithm: :concurrently
end
e... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20201027024317_create_notice_of_disagreements.rb | class CreateNoticeOfDisagreements < ActiveRecord::Migration[6.0]
def change
enable_extension 'uuid-ossp'
enable_extension 'pgcrypto'
create_table :appeals_api_notice_of_disagreements, id: :uuid do |t|
t.string :encrypted_form_data
t.string :encrypted_form_data_iv
t.string :encrypted_aut... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20211027215259_create_user_accounts.rb | class CreateUserAccounts < ActiveRecord::Migration[6.1]
def change
create_table :user_accounts, id: :uuid do |t|
t.string :icn
t.timestamps
t.index :icn, name: "index_user_accounts_on_icn", unique: true
end
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240507200527_update_ivc_champva_forms_indices.rb | # frozen_string_literal: true
class UpdateIvcChampvaFormsIndices < ActiveRecord::Migration[7.1]
disable_ddl_transaction!
def change
add_index :ivc_champva_forms, :form_uuid, algorithm: :concurrently, if_not_exists: true
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240418233828_create_accredited_representative_portal_verified_representatives.rb | # frozen_string_literal: true
# NOTE: This table was renamed and then dropped in the migration `DropAccreditedRepresentativePortalPilotRepresentatives`
class CreateAccreditedRepresentativePortalVerifiedRepresentatives < ActiveRecord::Migration[7.1]
def change
create_table :accredited_representative_portal_verifie... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20250819181750_add_default_attempts_to_event_bus_gateway_notifications.rb | class AddDefaultAttemptsToEventBusGatewayNotifications < ActiveRecord::Migration[7.2]
def up
change_column_default :event_bus_gateway_notifications, :attempts, 1
EventBusGatewayNotification.where(attempts: nil).update_all(attempts: 1)
end
def down
change_column_default :event_bus_gateway_notification... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20250506172106_add_needs_kms_rotation_fields_to_submissions_tables.rb | class AddNeedsKmsRotationFieldsToSubmissionsTables < ActiveRecord::Migration[7.2]
def change
tables = ApplicationRecord.descendants_using_encryption.select do |t|
!t.column_names.include?('needs_kms_rotation')
end.map(&:table_name).uniq
tables.each do |table|
add_column table, :needs_kms_rota... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20250915190655_add_credential_attributes_digest_column_to_user_verifications.rb | class AddCredentialAttributesDigestColumnToUserVerifications < ActiveRecord::Migration[7.2]
def change
add_column :user_verifications, :credential_attributes_digest, :string, null: true
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20220609131439_change_oauth_sessions_client_id_null_false.rb | class ChangeOAuthSessionsClientIdNullFalse < ActiveRecord::Migration[6.1]
def up
safety_assured do
SignIn::OAuthSession.delete_all
change_column_null :oauth_sessions, :client_id, false
end
end
def down
safety_assured do
change_column_null :oauth_sessions, :client_id, true
end
... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20241112215714_drop_pension_ipf_notifications.rb | class DropPensionIpfNotifications < ActiveRecord::Migration[7.1]
def change
drop_table :pension_ipf_notifications, if_exists: true
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20231019212352_update_staging_env_postgis.rb |
class UpdateStagingEnvPostgis < ActiveRecord::Migration[6.1]
def up
if Settings.vsp_environment == "staging"
connection.execute("SELECT postgis_extensions_upgrade();")
connection.execute("SELECT postgis_extensions_upgrade();")
end
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240628195735_add_index_on_flipper_features.rb | class AddIndexOnFlipperFeatures < ActiveRecord::Migration[7.1]
disable_ddl_transaction!
def change
safety_assured do
execute 'CREATE UNIQUE INDEX index_flipper_features_on_key ON public.flipper_features USING btree (key);'
end
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20241218183417_add_proc_id_index_to_claims_api_power_of_attorney_requests.rb | class AddProcIdIndexToClaimsApiPowerOfAttorneyRequests < ActiveRecord::Migration[7.0]
disable_ddl_transaction!
def change
add_index :claims_api_power_of_attorney_requests, :proc_id, algorithm: :concurrently
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20250421190417_add_needs_kms_rotation_to_encrypted_models.rb | class AddNeedsKmsRotationToEncryptedModels < ActiveRecord::Migration[7.2]
def change
tables = ApplicationRecord.descendants_using_encryption.map(&:table_name).uniq
tables.each do |table|
add_column table, :needs_kms_rotation, :boolean, default: false, null: false
end
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20230824175915_create_terms_of_use_agreements.rb | class CreateTermsOfUseAgreements < ActiveRecord::Migration[6.1]
def change
create_table :terms_of_use_agreements do |t|
t.references :user_account, null: false, foreign_key: true, type: :uuid
t.string :agreement_version, null: false
t.integer :response, null: false
t.timestamps
end
e... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20251114032623_create_event_bus_gateway_push_notifications.rb | # frozen_string_literal: true
class CreateEventBusGatewayPushNotifications < ActiveRecord::Migration[7.2]
def change
create_table :event_bus_gateway_push_notifications do |t|
t.references :user_account, null: false, foreign_key: true, type: :uuid
t.string :template_id, null: false
t.timestamps... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240722150751_add_client_configs_array_defaults.rb | class AddClientConfigsArrayDefaults < ActiveRecord::Migration[7.1]
def change
change_column_default :client_configs, :certificates, from: nil, to: []
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20220920211515_evidence_waiver_submission.rb | class EvidenceWaiverSubmission < ActiveRecord::Migration[6.1]
def change
create_table :claims_api_evidence_waiver_submissions, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.text :auth_headers_ciphertext
t.text :encrypted_kms_key
t.string :cid
t.timestamps
end
end
end |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20231005170708_index_veteran_representatives_on_location.rb | class IndexVeteranRepresentativesOnLocation < ActiveRecord::Migration[6.1]
disable_ddl_transaction!
def change
add_index :veteran_representatives, :location, using: :gist, algorithm: :concurrently
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240411235242_create_pega_table.rb | class CreatePegaTable < ActiveRecord::Migration[7.1]
def change
create_table :pega_tables do |t|
t.uuid :uuid
t.string :veteranfirstname
t.string :veteranmiddlename
t.string :veteranlastname
t.string :applicantfirstname
t.string :applicantmiddlename
t.string :applicantlas... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20251125141602_validate_not_null_digital_dispute_submissions_guid.rb | # frozen_string_literal: true
class ValidateNotNullDigitalDisputeSubmissionsGuid < ActiveRecord::Migration[7.2]
disable_ddl_transaction!
def up
validate_check_constraint :digital_dispute_submissions, name: 'digital_dispute_submissions_guid_null'
change_column_null :digital_dispute_submissions, :guid, fals... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240708210311_update_index_on_ivc_champva_forms.rb | class UpdateIndexOnIvcChampvaForms < ActiveRecord::Migration[7.1]
disable_ddl_transaction!
def up
safety_assured do
execute "DROP INDEX CONCURRENTLY IF EXISTS index_ivc_champva_forms_on_form_uuid;"
execute "CREATE INDEX CONCURRENTLY index_ivc_champva_forms_on_form_uuid ON public.ivc_champva_forms U... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20210826205558_create_account_login_stats.rb | class CreateAccountLoginStats < ActiveRecord::Migration[6.1]
def change
create_table :account_login_stats do |t|
t.references :account, foreign_key: true, null: false, index: { unique: true }
t.datetime :idme_at, index: true
t.datetime :myhealthevet_at, index: true
t.datetime :dslogon_at, ... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240606200414_add_form_start_date_to_saved_claims.rb | class AddFormStartDateToSavedClaims < ActiveRecord::Migration[7.1]
def change
add_column :saved_claims, :form_start_date, :datetime
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20250430165555_add_user_account_to_schema_contract_validations.rb | class AddUserAccountToSchemaContractValidations < ActiveRecord::Migration[7.2]
disable_ddl_transaction!
def change
add_reference :schema_contract_validations, :user_account, type: :uuid, null: true, index: { algorithm: :concurrently }
add_foreign_key :schema_contract_validations, :user_accounts, validate: ... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20250312085154_create_lighthouse_submission_attempts.rb | class CreateLighthouseSubmissionAttempts < ActiveRecord::Migration[7.2]
def change
create_table :lighthouse_submission_attempts do |t|
t.timestamps
t.references :lighthouse_submission, null: false, foreign_key: true
t.enum :status, enum_type: 'lighthouse_submission_status', default: 'pending'
... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20231207022820_create_form_submission_attempts.rb | class CreateFormSubmissionAttempts < ActiveRecord::Migration[6.1]
def change
create_table :form_submission_attempts do |t|
t.references :form_submission, foreign_key: true, null: false
t.jsonb :response
t.string :aasm_state
t.string :error_message
t.text :encrypted_kms_key
t.t... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20251208202434_add_file_uuid_index_to_decision_review_notification_audit_logs.rb | # frozen_string_literal: true
class AddFileUuidIndexToDecisionReviewNotificationAuditLogs < ActiveRecord::Migration[7.1]
disable_ddl_transaction!
def change
add_index :decision_review_notification_audit_logs, :vbms_file_uuid,
algorithm: :concurrently,
if_not_exists: true
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240820164130_add_fuzzystrmatch_extension.rb | class AddFuzzystrmatchExtension < ActiveRecord::Migration[7.1]
def change
enable_extension 'fuzzystrmatch'
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20210312211214_add_metadata_to_upload_submission.rb | class AddMetadataToUploadSubmission < ActiveRecord::Migration[6.0]
def change
add_column :vba_documents_upload_submissions, :metadata, :jsonb, default: {}
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20240416155705_create_ivc_champva_forms.rb | class CreateIvcChampvaForms < ActiveRecord::Migration[7.1]
def change
create_table :ivc_champva_forms do |t|
t.string :email
t.string :first_name
t.string :last_name
t.string :form_number
t.string :file_name
t.uuid :form_uuid
t.string :s3_status
t.string :pega_sta... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20220628222858_add_user_account_uuid_to_in_progress_forms.rb | class AddUserAccountUuidToInProgressForms < ActiveRecord::Migration[6.1]
def change
safety_assured do
add_reference :in_progress_forms, :user_account, type: :uuid, foreign_key: true, null: true, index: true
end
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20250923015956_recreate_user_account_id_column_with_index.rb | class RecreateUserAccountIdColumnWithIndex < ActiveRecord::Migration[7.2]
disable_ddl_transaction!
def change
safety_assured { remove_column :saved_claims, :user_account_id }
# TODO: add foreign key constraint once this migration is deployed to all environments
add_reference :saved_claims, :user_accoun... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20230922221247_add_enforced_terms_to_client_config.rb | class AddEnforcedTermsToClientConfig < ActiveRecord::Migration[6.1]
def change
add_column :client_configs, :terms_of_use_url, :text
add_column :client_configs, :enforced_terms, :text
end
end
|
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20251201135954_swap_digital_dispute_submissions_id_columns.rb | # frozen_string_literal: true
class SwapDigitalDisputeSubmissionsIdColumns < ActiveRecord::Migration[7.2]
def up
safety_assured do
drop_uuid_primary_key
swap_columns
setup_bigint_primary_key
end
end
private
def drop_uuid_primary_key
execute 'ALTER TABLE digital_dispute_submissio... |
0 | code_files/vets-api-private/db | code_files/vets-api-private/db/migrate/20230713182204_create_credential_adoption_email_records.rb | class CreateCredentialAdoptionEmailRecords < ActiveRecord::Migration[6.1]
def change
create_table :credential_adoption_email_records do |t|
t.string :icn, null: false
t.string :email_address, null: false
t.string :email_template_id, null: false
t.datetime :email_triggered_at
t.times... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.