snapshot of https://github.com/ory/kratos.git (master, 2026-09-15; blobs > 131072B omitted)
Some checks failed
CI / Run tests and lints (push) Failing after 29s
CI / Build CLI docs (push) Has been skipped
CI / Run Playwright end-to-end tests (mysql) (push) Failing after 3s
CI / Run Playwright end-to-end tests (postgres) (push) Failing after 2s
CI / Run Playwright end-to-end tests (sqlite) (push) Failing after 3s
CodeQL / Analyze (go) (push) Failing after 4s
CodeQL / Analyze (javascript) (push) Failing after 3s
Docker Image Scanners / scanners (push) Failing after 4s
Synchronize Issue Labels / Synchronize Issue Labels (push) Has been skipped
CI / Run end-to-end tests (postgres) (push) Failing after 19s
CI / Run end-to-end tests (sqlite) (push) Failing after 2s
CI / Run Playwright end-to-end tests (cockroach) (push) Failing after 2s
CI / Draft newsletter (push) Has been skipped
CI / Generate release (push) Has been skipped
CI / Pending approval Slack notification (push) Has been skipped
CI / Send newsletter (push) Has been skipped

This commit is contained in:
upstream-mirror
2026-09-15 21:19:12 +05:00
commit c60cc7ca75
8092 changed files with 394160 additions and 0 deletions

View File

@@ -0,0 +1,212 @@
stdout: Version Name Status
20191100000001000000 identities Applied
20191100000001000001 identities Applied
20191100000001000002 identities Applied
20191100000001000003 identities Applied
20191100000001000004 identities Applied
20191100000001000005 identities Applied
20191100000002000000 requests Applied
20191100000002000001 requests Applied
20191100000002000002 requests Applied
20191100000002000003 requests Applied
20191100000002000004 requests Applied
20191100000003000000 sessions Applied
20191100000004000000 errors Applied
20191100000006000000 courier Applied
20191100000007000000 errors Applied
20191100000007000001 errors Applied
20191100000007000002 errors Applied
20191100000007000003 errors Applied
20191100000008000000 selfservice_verification Applied
20191100000008000001 selfservice_verification Applied
20191100000008000002 selfservice_verification Applied
20191100000008000003 selfservice_verification Applied
20191100000008000004 selfservice_verification Applied
20191100000008000005 selfservice_verification Applied
20191100000010000000 errors Applied
20191100000010000001 errors Applied
20191100000010000002 errors Applied
20191100000010000003 errors Applied
20191100000010000004 errors Applied
20191100000011000000 courier_body_type Applied
20191100000011000001 courier_body_type Applied
20191100000011000002 courier_body_type Applied
20191100000011000003 courier_body_type Applied
20191100000012000000 login_request_forced Applied
20191100000012000001 login_request_forced Applied
20191100000012000002 login_request_forced Applied
20191100000012000003 login_request_forced Applied
20200317160354000000 create_profile_request_forms Applied
20200317160354000001 create_profile_request_forms Applied
20200317160354000002 create_profile_request_forms Applied
20200317160354000003 create_profile_request_forms Applied
20200317160354000004 create_profile_request_forms Applied
20200317160354000005 create_profile_request_forms Applied
20200317160354000006 create_profile_request_forms Applied
20200401183443000000 continuity_containers Applied
20200402142539000000 rename_profile_flows Applied
20200402142539000001 rename_profile_flows Applied
20200402142539000002 rename_profile_flows Applied
20200519101057000000 create_recovery_addresses Applied
20200519101057000001 create_recovery_addresses Applied
20200519101057000002 create_recovery_addresses Applied
20200519101057000003 create_recovery_addresses Applied
20200519101057000004 create_recovery_addresses Applied
20200519101057000005 create_recovery_addresses Applied
20200519101057000006 create_recovery_addresses Applied
20200519101057000007 create_recovery_addresses Applied
20200601101000000000 create_messages Applied
20200601101000000001 create_messages Applied
20200601101000000002 create_messages Applied
20200601101000000003 create_messages Applied
20200605111551000000 messages Applied
20200605111551000001 messages Applied
20200605111551000002 messages Applied
20200605111551000003 messages Applied
20200605111551000004 messages Applied
20200605111551000005 messages Applied
20200605111551000006 messages Applied
20200605111551000007 messages Applied
20200605111551000008 messages Applied
20200605111551000009 messages Applied
20200605111551000010 messages Applied
20200605111551000011 messages Applied
20200607165100000000 settings Applied
20200607165100000001 settings Applied
20200607165100000002 settings Applied
20200607165100000003 settings Applied
20200607165100000004 settings Applied
20200705105359000000 rename_identities_schema Applied
20200810141652000000 flow_type Applied
20200810141652000001 flow_type Applied
20200810141652000002 flow_type Applied
20200810141652000003 flow_type Applied
20200810141652000004 flow_type Applied
20200810141652000005 flow_type Applied
20200810141652000006 flow_type Applied
20200810141652000007 flow_type Applied
20200810141652000008 flow_type Applied
20200810141652000009 flow_type Applied
20200810141652000010 flow_type Applied
20200810141652000011 flow_type Applied
20200810141652000012 flow_type Applied
20200810141652000013 flow_type Applied
20200810141652000014 flow_type Applied
20200810141652000015 flow_type Applied
20200810141652000016 flow_type Applied
20200810141652000017 flow_type Applied
20200810141652000018 flow_type Applied
20200810141652000019 flow_type Applied
20200810161022000000 flow_rename Applied
20200810161022000001 flow_rename Applied
20200810161022000002 flow_rename Applied
20200810161022000003 flow_rename Applied
20200810161022000004 flow_rename Applied
20200810161022000005 flow_rename Applied
20200810161022000006 flow_rename Applied
20200810161022000007 flow_rename Applied
20200810161022000008 flow_rename Applied
20200810162450000000 flow_fields_rename Applied
20200810162450000001 flow_fields_rename Applied
20200810162450000002 flow_fields_rename Applied
20200810162450000003 flow_fields_rename Applied
20200812124254000000 add_session_token Applied
20200812124254000001 add_session_token Applied
20200812124254000002 add_session_token Applied
20200812124254000003 add_session_token Applied
20200812124254000004 add_session_token Applied
20200812124254000005 add_session_token Applied
20200812124254000006 add_session_token Applied
20200812124254000007 add_session_token Applied
20200812160551000000 add_session_revoke Applied
20200812160551000001 add_session_revoke Applied
20200812160551000002 add_session_revoke Applied
20200812160551000003 add_session_revoke Applied
20200812160551000004 add_session_revoke Applied
20200812160551000005 add_session_revoke Applied
20200812160551000006 add_session_revoke Applied
20200812160551000007 add_session_revoke Applied
20200830121710000000 update_recovery_token Applied
20200830130642000000 add_verification_methods Applied
20200830130642000001 add_verification_methods Applied
20200830130642000002 add_verification_methods Applied
20200830130642000003 add_verification_methods Applied
20200830130642000004 add_verification_methods Applied
20200830130642000005 add_verification_methods Applied
20200830130642000006 add_verification_methods Applied
20200830130642000007 add_verification_methods Applied
20200830130642000008 add_verification_methods Applied
20200830130642000009 add_verification_methods Applied
20200830130642000010 add_verification_methods Applied
20200830130643000000 add_verification_methods Applied
20200830130644000000 add_verification_methods Applied
20200830130644000001 add_verification_methods Applied
20200830130645000000 add_verification_methods Applied
20200830130646000000 add_verification_methods Applied
20200830130646000001 add_verification_methods Applied
20200830130646000002 add_verification_methods Applied
20200830130646000003 add_verification_methods Applied
20200830130646000004 add_verification_methods Applied
20200830130646000005 add_verification_methods Applied
20200830130646000006 add_verification_methods Applied
20200830130646000007 add_verification_methods Applied
20200830130646000008 add_verification_methods Applied
20200830130646000009 add_verification_methods Applied
20200830130646000010 add_verification_methods Applied
20200830130646000011 add_verification_methods Applied
20200830154602000000 add_verification_token Applied
20200830154602000001 add_verification_token Applied
20200830154602000002 add_verification_token Applied
20200830154602000003 add_verification_token Applied
20200830154602000004 add_verification_token Applied
20200830172221000000 recovery_token_expires Applied
20200830172221000001 recovery_token_expires Applied
20200830172221000002 recovery_token_expires Applied
20200830172221000003 recovery_token_expires Applied
20200830172221000004 recovery_token_expires Applied
20200830172221000005 recovery_token_expires Applied
20200830172221000006 recovery_token_expires Applied
20200830172221000007 recovery_token_expires Applied
20200830172221000008 recovery_token_expires Applied
20200830172221000009 recovery_token_expires Applied
20200830172221000010 recovery_token_expires Applied
20200830172221000011 recovery_token_expires Applied
20200830172221000012 recovery_token_expires Applied
20200830172221000013 recovery_token_expires Applied
20200830172221000014 recovery_token_expires Applied
20200830172221000015 recovery_token_expires Applied
20200830172221000016 recovery_token_expires Applied
20200830172221000017 recovery_token_expires Applied
20200830172221000018 recovery_token_expires Applied
20200830172221000019 recovery_token_expires Applied
20200830172221000020 recovery_token_expires Applied
20200830172221000021 recovery_token_expires Applied
20200830172221000022 recovery_token_expires Applied
20200830172221000023 recovery_token_expires Applied
20200830172221000024 recovery_token_expires Applied
20200831110752000000 identity_verifiable_address_remove_code Applied
20200831110752000001 identity_verifiable_address_remove_code Applied
20200831110752000002 identity_verifiable_address_remove_code Applied
20200831110752000003 identity_verifiable_address_remove_code Applied
20200831110752000004 identity_verifiable_address_remove_code Applied
20200831110752000005 identity_verifiable_address_remove_code Applied
20200831110752000006 identity_verifiable_address_remove_code Applied
20200831110752000007 identity_verifiable_address_remove_code Applied
20200831110752000008 identity_verifiable_address_remove_code Applied
20200831110752000009 identity_verifiable_address_remove_code Applied
20200831110752000010 identity_verifiable_address_remove_code Applied
20200831110752000011 identity_verifiable_address_remove_code Applied
20200831110752000012 identity_verifiable_address_remove_code Applied
20200831110752000013 identity_verifiable_address_remove_code Applied
20200831110752000014 identity_verifiable_address_remove_code Applied
20200831110752000015 identity_verifiable_address_remove_code Applied
20200831110752000016 identity_verifiable_address_remove_code Applied
20200831110752000017 identity_verifiable_address_remove_code Applied
20200831110752000018 identity_verifiable_address_remove_code Applied
20200831110752000019 identity_verifiable_address_remove_code Applied
20200831110752000020 identity_verifiable_address_remove_code Applied
20200831110752000021 identity_verifiable_address_remove_code Applied
20201201161451000000 credential_types_values Applied
20201201161451000001 credential_types_values Applied
stderr:

View File

@@ -0,0 +1,225 @@
stdout: The migration plan is as follows:
Version Name Status
20191100000001000000 identities Applied
20191100000001000001 identities Applied
20191100000001000002 identities Applied
20191100000001000003 identities Applied
20191100000001000004 identities Applied
20191100000001000005 identities Applied
20191100000002000000 requests Applied
20191100000002000001 requests Applied
20191100000002000002 requests Applied
20191100000002000003 requests Applied
20191100000002000004 requests Applied
20191100000003000000 sessions Applied
20191100000004000000 errors Applied
20191100000006000000 courier Applied
20191100000007000000 errors Applied
20191100000007000001 errors Applied
20191100000007000002 errors Applied
20191100000007000003 errors Applied
20191100000008000000 selfservice_verification Applied
20191100000008000001 selfservice_verification Applied
20191100000008000002 selfservice_verification Applied
20191100000008000003 selfservice_verification Applied
20191100000008000004 selfservice_verification Applied
20191100000008000005 selfservice_verification Applied
20191100000010000000 errors Applied
20191100000010000001 errors Applied
20191100000010000002 errors Applied
20191100000010000003 errors Applied
20191100000010000004 errors Applied
20191100000011000000 courier_body_type Applied
20191100000011000001 courier_body_type Applied
20191100000011000002 courier_body_type Applied
20191100000011000003 courier_body_type Applied
20191100000012000000 login_request_forced Applied
20191100000012000001 login_request_forced Applied
20191100000012000002 login_request_forced Applied
20191100000012000003 login_request_forced Applied
20200317160354000000 create_profile_request_forms Applied
20200317160354000001 create_profile_request_forms Applied
20200317160354000002 create_profile_request_forms Applied
20200317160354000003 create_profile_request_forms Applied
20200317160354000004 create_profile_request_forms Applied
20200317160354000005 create_profile_request_forms Applied
20200317160354000006 create_profile_request_forms Applied
20200401183443000000 continuity_containers Applied
20200402142539000000 rename_profile_flows Applied
20200402142539000001 rename_profile_flows Applied
20200402142539000002 rename_profile_flows Applied
20200519101057000000 create_recovery_addresses Applied
20200519101057000001 create_recovery_addresses Applied
20200519101057000002 create_recovery_addresses Applied
20200519101057000003 create_recovery_addresses Applied
20200519101057000004 create_recovery_addresses Applied
20200519101057000005 create_recovery_addresses Applied
20200519101057000006 create_recovery_addresses Applied
20200519101057000007 create_recovery_addresses Applied
20200601101000000000 create_messages Applied
20200601101000000001 create_messages Applied
20200601101000000002 create_messages Applied
20200601101000000003 create_messages Applied
20200605111551000000 messages Applied
20200605111551000001 messages Applied
20200605111551000002 messages Applied
20200605111551000003 messages Applied
20200605111551000004 messages Applied
20200605111551000005 messages Applied
20200605111551000006 messages Applied
20200605111551000007 messages Applied
20200605111551000008 messages Applied
20200605111551000009 messages Applied
20200605111551000010 messages Applied
20200605111551000011 messages Applied
20200607165100000000 settings Applied
20200607165100000001 settings Applied
20200607165100000002 settings Applied
20200607165100000003 settings Applied
20200607165100000004 settings Applied
20200705105359000000 rename_identities_schema Applied
20200810141652000000 flow_type Applied
20200810141652000001 flow_type Applied
20200810141652000002 flow_type Applied
20200810141652000003 flow_type Applied
20200810141652000004 flow_type Applied
20200810141652000005 flow_type Applied
20200810141652000006 flow_type Applied
20200810141652000007 flow_type Applied
20200810141652000008 flow_type Applied
20200810141652000009 flow_type Applied
20200810141652000010 flow_type Applied
20200810141652000011 flow_type Applied
20200810141652000012 flow_type Applied
20200810141652000013 flow_type Applied
20200810141652000014 flow_type Applied
20200810141652000015 flow_type Applied
20200810141652000016 flow_type Applied
20200810141652000017 flow_type Applied
20200810141652000018 flow_type Applied
20200810141652000019 flow_type Applied
20200810161022000000 flow_rename Applied
20200810161022000001 flow_rename Applied
20200810161022000002 flow_rename Applied
20200810161022000003 flow_rename Applied
20200810161022000004 flow_rename Applied
20200810161022000005 flow_rename Applied
20200810161022000006 flow_rename Applied
20200810161022000007 flow_rename Applied
20200810161022000008 flow_rename Applied
20200810162450000000 flow_fields_rename Applied
20200810162450000001 flow_fields_rename Applied
20200810162450000002 flow_fields_rename Applied
20200810162450000003 flow_fields_rename Applied
20200812124254000000 add_session_token Applied
20200812124254000001 add_session_token Applied
20200812124254000002 add_session_token Applied
20200812124254000003 add_session_token Applied
20200812124254000004 add_session_token Applied
20200812124254000005 add_session_token Applied
20200812124254000006 add_session_token Applied
20200812124254000007 add_session_token Applied
20200812160551000000 add_session_revoke Applied
20200812160551000001 add_session_revoke Applied
20200812160551000002 add_session_revoke Applied
20200812160551000003 add_session_revoke Applied
20200812160551000004 add_session_revoke Applied
20200812160551000005 add_session_revoke Applied
20200812160551000006 add_session_revoke Applied
20200812160551000007 add_session_revoke Applied
20200830121710000000 update_recovery_token Applied
20200830130642000000 add_verification_methods Applied
20200830130642000001 add_verification_methods Applied
20200830130642000002 add_verification_methods Applied
20200830130642000003 add_verification_methods Applied
20200830130642000004 add_verification_methods Applied
20200830130642000005 add_verification_methods Applied
20200830130642000006 add_verification_methods Applied
20200830130642000007 add_verification_methods Applied
20200830130642000008 add_verification_methods Applied
20200830130642000009 add_verification_methods Applied
20200830130642000010 add_verification_methods Applied
20200830130643000000 add_verification_methods Applied
20200830130644000000 add_verification_methods Applied
20200830130644000001 add_verification_methods Applied
20200830130645000000 add_verification_methods Applied
20200830130646000000 add_verification_methods Applied
20200830130646000001 add_verification_methods Applied
20200830130646000002 add_verification_methods Applied
20200830130646000003 add_verification_methods Applied
20200830130646000004 add_verification_methods Applied
20200830130646000005 add_verification_methods Applied
20200830130646000006 add_verification_methods Applied
20200830130646000007 add_verification_methods Applied
20200830130646000008 add_verification_methods Applied
20200830130646000009 add_verification_methods Applied
20200830130646000010 add_verification_methods Applied
20200830130646000011 add_verification_methods Applied
20200830154602000000 add_verification_token Applied
20200830154602000001 add_verification_token Applied
20200830154602000002 add_verification_token Applied
20200830154602000003 add_verification_token Applied
20200830154602000004 add_verification_token Applied
20200830172221000000 recovery_token_expires Applied
20200830172221000001 recovery_token_expires Applied
20200830172221000002 recovery_token_expires Applied
20200830172221000003 recovery_token_expires Applied
20200830172221000004 recovery_token_expires Applied
20200830172221000005 recovery_token_expires Applied
20200830172221000006 recovery_token_expires Applied
20200830172221000007 recovery_token_expires Applied
20200830172221000008 recovery_token_expires Applied
20200830172221000009 recovery_token_expires Applied
20200830172221000010 recovery_token_expires Applied
20200830172221000011 recovery_token_expires Applied
20200830172221000012 recovery_token_expires Applied
20200830172221000013 recovery_token_expires Applied
20200830172221000014 recovery_token_expires Applied
20200830172221000015 recovery_token_expires Applied
20200830172221000016 recovery_token_expires Applied
20200830172221000017 recovery_token_expires Applied
20200830172221000018 recovery_token_expires Applied
20200830172221000019 recovery_token_expires Applied
20200830172221000020 recovery_token_expires Applied
20200830172221000021 recovery_token_expires Applied
20200830172221000022 recovery_token_expires Applied
20200830172221000023 recovery_token_expires Applied
20200830172221000024 recovery_token_expires Applied
20200831110752000000 identity_verifiable_address_remove_code Applied
20200831110752000001 identity_verifiable_address_remove_code Applied
20200831110752000002 identity_verifiable_address_remove_code Applied
20200831110752000003 identity_verifiable_address_remove_code Applied
20200831110752000004 identity_verifiable_address_remove_code Applied
20200831110752000005 identity_verifiable_address_remove_code Applied
20200831110752000006 identity_verifiable_address_remove_code Applied
20200831110752000007 identity_verifiable_address_remove_code Applied
20200831110752000008 identity_verifiable_address_remove_code Applied
20200831110752000009 identity_verifiable_address_remove_code Applied
20200831110752000010 identity_verifiable_address_remove_code Applied
20200831110752000011 identity_verifiable_address_remove_code Applied
20200831110752000012 identity_verifiable_address_remove_code Applied
20200831110752000013 identity_verifiable_address_remove_code Applied
20200831110752000014 identity_verifiable_address_remove_code Applied
20200831110752000015 identity_verifiable_address_remove_code Applied
20200831110752000016 identity_verifiable_address_remove_code Applied
20200831110752000017 identity_verifiable_address_remove_code Applied
20200831110752000018 identity_verifiable_address_remove_code Rollback
20200831110752000019 identity_verifiable_address_remove_code Rollback
20200831110752000020 identity_verifiable_address_remove_code Pending
20200831110752000021 identity_verifiable_address_remove_code Pending
20201201161451000000 credential_types_values Pending
20201201161451000001 credential_types_values Pending
The SQL statements to be executed from top to bottom are:
------------ 20200831110752000019 - identity_verifiable_address_remove_code ------------
UPDATE identity_verifiable_addresses SET code = substr(hex(randomblob(32)), 0, 32) WHERE code IS NULL
------------ 20200831110752000018 - identity_verifiable_address_remove_code ------------
UPDATE identity_verifiable_addresses SET expires_at = CURRENT_TIMESTAMP WHERE expires_at IS NULL
Do you wish to execute this migration plan? [y/n]: ------------ WARNING ------------
Migration aborted.
stderr: To skip the next question use flag --yes (at your own risk).

View File

@@ -0,0 +1,217 @@
stdout: The migration plan is as follows:
Version Name Status
20191100000001000000 identities Applied
20191100000001000001 identities Applied
20191100000001000002 identities Applied
20191100000001000003 identities Applied
20191100000001000004 identities Applied
20191100000001000005 identities Applied
20191100000002000000 requests Applied
20191100000002000001 requests Applied
20191100000002000002 requests Applied
20191100000002000003 requests Applied
20191100000002000004 requests Applied
20191100000003000000 sessions Applied
20191100000004000000 errors Applied
20191100000006000000 courier Applied
20191100000007000000 errors Applied
20191100000007000001 errors Applied
20191100000007000002 errors Applied
20191100000007000003 errors Applied
20191100000008000000 selfservice_verification Applied
20191100000008000001 selfservice_verification Applied
20191100000008000002 selfservice_verification Applied
20191100000008000003 selfservice_verification Applied
20191100000008000004 selfservice_verification Applied
20191100000008000005 selfservice_verification Applied
20191100000010000000 errors Applied
20191100000010000001 errors Applied
20191100000010000002 errors Applied
20191100000010000003 errors Applied
20191100000010000004 errors Applied
20191100000011000000 courier_body_type Applied
20191100000011000001 courier_body_type Applied
20191100000011000002 courier_body_type Applied
20191100000011000003 courier_body_type Applied
20191100000012000000 login_request_forced Applied
20191100000012000001 login_request_forced Applied
20191100000012000002 login_request_forced Applied
20191100000012000003 login_request_forced Applied
20200317160354000000 create_profile_request_forms Applied
20200317160354000001 create_profile_request_forms Applied
20200317160354000002 create_profile_request_forms Applied
20200317160354000003 create_profile_request_forms Applied
20200317160354000004 create_profile_request_forms Applied
20200317160354000005 create_profile_request_forms Applied
20200317160354000006 create_profile_request_forms Applied
20200401183443000000 continuity_containers Applied
20200402142539000000 rename_profile_flows Applied
20200402142539000001 rename_profile_flows Applied
20200402142539000002 rename_profile_flows Applied
20200519101057000000 create_recovery_addresses Applied
20200519101057000001 create_recovery_addresses Applied
20200519101057000002 create_recovery_addresses Applied
20200519101057000003 create_recovery_addresses Applied
20200519101057000004 create_recovery_addresses Applied
20200519101057000005 create_recovery_addresses Applied
20200519101057000006 create_recovery_addresses Applied
20200519101057000007 create_recovery_addresses Applied
20200601101000000000 create_messages Applied
20200601101000000001 create_messages Applied
20200601101000000002 create_messages Applied
20200601101000000003 create_messages Applied
20200605111551000000 messages Applied
20200605111551000001 messages Applied
20200605111551000002 messages Applied
20200605111551000003 messages Applied
20200605111551000004 messages Applied
20200605111551000005 messages Applied
20200605111551000006 messages Applied
20200605111551000007 messages Applied
20200605111551000008 messages Applied
20200605111551000009 messages Applied
20200605111551000010 messages Applied
20200605111551000011 messages Applied
20200607165100000000 settings Applied
20200607165100000001 settings Applied
20200607165100000002 settings Applied
20200607165100000003 settings Applied
20200607165100000004 settings Applied
20200705105359000000 rename_identities_schema Applied
20200810141652000000 flow_type Applied
20200810141652000001 flow_type Applied
20200810141652000002 flow_type Applied
20200810141652000003 flow_type Applied
20200810141652000004 flow_type Applied
20200810141652000005 flow_type Applied
20200810141652000006 flow_type Applied
20200810141652000007 flow_type Applied
20200810141652000008 flow_type Applied
20200810141652000009 flow_type Applied
20200810141652000010 flow_type Applied
20200810141652000011 flow_type Applied
20200810141652000012 flow_type Applied
20200810141652000013 flow_type Applied
20200810141652000014 flow_type Applied
20200810141652000015 flow_type Applied
20200810141652000016 flow_type Applied
20200810141652000017 flow_type Applied
20200810141652000018 flow_type Applied
20200810141652000019 flow_type Applied
20200810161022000000 flow_rename Applied
20200810161022000001 flow_rename Applied
20200810161022000002 flow_rename Applied
20200810161022000003 flow_rename Applied
20200810161022000004 flow_rename Applied
20200810161022000005 flow_rename Applied
20200810161022000006 flow_rename Applied
20200810161022000007 flow_rename Applied
20200810161022000008 flow_rename Applied
20200810162450000000 flow_fields_rename Applied
20200810162450000001 flow_fields_rename Applied
20200810162450000002 flow_fields_rename Applied
20200810162450000003 flow_fields_rename Applied
20200812124254000000 add_session_token Applied
20200812124254000001 add_session_token Applied
20200812124254000002 add_session_token Applied
20200812124254000003 add_session_token Applied
20200812124254000004 add_session_token Applied
20200812124254000005 add_session_token Applied
20200812124254000006 add_session_token Applied
20200812124254000007 add_session_token Applied
20200812160551000000 add_session_revoke Applied
20200812160551000001 add_session_revoke Applied
20200812160551000002 add_session_revoke Applied
20200812160551000003 add_session_revoke Applied
20200812160551000004 add_session_revoke Applied
20200812160551000005 add_session_revoke Applied
20200812160551000006 add_session_revoke Applied
20200812160551000007 add_session_revoke Applied
20200830121710000000 update_recovery_token Applied
20200830130642000000 add_verification_methods Applied
20200830130642000001 add_verification_methods Applied
20200830130642000002 add_verification_methods Applied
20200830130642000003 add_verification_methods Applied
20200830130642000004 add_verification_methods Applied
20200830130642000005 add_verification_methods Applied
20200830130642000006 add_verification_methods Applied
20200830130642000007 add_verification_methods Applied
20200830130642000008 add_verification_methods Applied
20200830130642000009 add_verification_methods Applied
20200830130642000010 add_verification_methods Applied
20200830130643000000 add_verification_methods Applied
20200830130644000000 add_verification_methods Applied
20200830130644000001 add_verification_methods Applied
20200830130645000000 add_verification_methods Applied
20200830130646000000 add_verification_methods Applied
20200830130646000001 add_verification_methods Applied
20200830130646000002 add_verification_methods Applied
20200830130646000003 add_verification_methods Applied
20200830130646000004 add_verification_methods Applied
20200830130646000005 add_verification_methods Applied
20200830130646000006 add_verification_methods Applied
20200830130646000007 add_verification_methods Applied
20200830130646000008 add_verification_methods Applied
20200830130646000009 add_verification_methods Applied
20200830130646000010 add_verification_methods Applied
20200830130646000011 add_verification_methods Applied
20200830154602000000 add_verification_token Applied
20200830154602000001 add_verification_token Applied
20200830154602000002 add_verification_token Applied
20200830154602000003 add_verification_token Applied
20200830154602000004 add_verification_token Applied
20200830172221000000 recovery_token_expires Applied
20200830172221000001 recovery_token_expires Applied
20200830172221000002 recovery_token_expires Applied
20200830172221000003 recovery_token_expires Applied
20200830172221000004 recovery_token_expires Applied
20200830172221000005 recovery_token_expires Applied
20200830172221000006 recovery_token_expires Applied
20200830172221000007 recovery_token_expires Applied
20200830172221000008 recovery_token_expires Applied
20200830172221000009 recovery_token_expires Applied
20200830172221000010 recovery_token_expires Applied
20200830172221000011 recovery_token_expires Applied
20200830172221000012 recovery_token_expires Applied
20200830172221000013 recovery_token_expires Applied
20200830172221000014 recovery_token_expires Applied
20200830172221000015 recovery_token_expires Applied
20200830172221000016 recovery_token_expires Applied
20200830172221000017 recovery_token_expires Applied
20200830172221000018 recovery_token_expires Applied
20200830172221000019 recovery_token_expires Applied
20200830172221000020 recovery_token_expires Applied
20200830172221000021 recovery_token_expires Applied
20200830172221000022 recovery_token_expires Applied
20200830172221000023 recovery_token_expires Applied
20200830172221000024 recovery_token_expires Applied
20200831110752000000 identity_verifiable_address_remove_code Applied
20200831110752000001 identity_verifiable_address_remove_code Applied
20200831110752000002 identity_verifiable_address_remove_code Applied
20200831110752000003 identity_verifiable_address_remove_code Applied
20200831110752000004 identity_verifiable_address_remove_code Applied
20200831110752000005 identity_verifiable_address_remove_code Applied
20200831110752000006 identity_verifiable_address_remove_code Applied
20200831110752000007 identity_verifiable_address_remove_code Applied
20200831110752000008 identity_verifiable_address_remove_code Applied
20200831110752000009 identity_verifiable_address_remove_code Applied
20200831110752000010 identity_verifiable_address_remove_code Applied
20200831110752000011 identity_verifiable_address_remove_code Applied
20200831110752000012 identity_verifiable_address_remove_code Applied
20200831110752000013 identity_verifiable_address_remove_code Applied
20200831110752000014 identity_verifiable_address_remove_code Applied
20200831110752000015 identity_verifiable_address_remove_code Applied
20200831110752000016 identity_verifiable_address_remove_code Applied
20200831110752000017 identity_verifiable_address_remove_code Applied
20200831110752000018 identity_verifiable_address_remove_code Applied
20200831110752000019 identity_verifiable_address_remove_code Applied
20200831110752000020 identity_verifiable_address_remove_code Pending
20200831110752000021 identity_verifiable_address_remove_code Pending
20201201161451000000 credential_types_values Pending
20201201161451000001 credential_types_values Pending
stderr:
There are apparently no migrations to roll back.
Please provide the --steps argument with a value larger than 0.

View File

@@ -0,0 +1,230 @@
stdout: The migration plan is as follows:
Version Name Status
20191100000001000000 identities Applied
20191100000001000001 identities Applied
20191100000001000002 identities Applied
20191100000001000003 identities Applied
20191100000001000004 identities Applied
20191100000001000005 identities Applied
20191100000002000000 requests Applied
20191100000002000001 requests Applied
20191100000002000002 requests Applied
20191100000002000003 requests Applied
20191100000002000004 requests Applied
20191100000003000000 sessions Applied
20191100000004000000 errors Applied
20191100000006000000 courier Applied
20191100000007000000 errors Applied
20191100000007000001 errors Applied
20191100000007000002 errors Applied
20191100000007000003 errors Applied
20191100000008000000 selfservice_verification Applied
20191100000008000001 selfservice_verification Applied
20191100000008000002 selfservice_verification Applied
20191100000008000003 selfservice_verification Applied
20191100000008000004 selfservice_verification Applied
20191100000008000005 selfservice_verification Applied
20191100000010000000 errors Applied
20191100000010000001 errors Applied
20191100000010000002 errors Applied
20191100000010000003 errors Applied
20191100000010000004 errors Applied
20191100000011000000 courier_body_type Applied
20191100000011000001 courier_body_type Applied
20191100000011000002 courier_body_type Applied
20191100000011000003 courier_body_type Applied
20191100000012000000 login_request_forced Applied
20191100000012000001 login_request_forced Applied
20191100000012000002 login_request_forced Applied
20191100000012000003 login_request_forced Applied
20200317160354000000 create_profile_request_forms Applied
20200317160354000001 create_profile_request_forms Applied
20200317160354000002 create_profile_request_forms Applied
20200317160354000003 create_profile_request_forms Applied
20200317160354000004 create_profile_request_forms Applied
20200317160354000005 create_profile_request_forms Applied
20200317160354000006 create_profile_request_forms Applied
20200401183443000000 continuity_containers Applied
20200402142539000000 rename_profile_flows Applied
20200402142539000001 rename_profile_flows Applied
20200402142539000002 rename_profile_flows Applied
20200519101057000000 create_recovery_addresses Applied
20200519101057000001 create_recovery_addresses Applied
20200519101057000002 create_recovery_addresses Applied
20200519101057000003 create_recovery_addresses Applied
20200519101057000004 create_recovery_addresses Applied
20200519101057000005 create_recovery_addresses Applied
20200519101057000006 create_recovery_addresses Applied
20200519101057000007 create_recovery_addresses Applied
20200601101000000000 create_messages Applied
20200601101000000001 create_messages Applied
20200601101000000002 create_messages Applied
20200601101000000003 create_messages Applied
20200605111551000000 messages Applied
20200605111551000001 messages Applied
20200605111551000002 messages Applied
20200605111551000003 messages Applied
20200605111551000004 messages Applied
20200605111551000005 messages Applied
20200605111551000006 messages Applied
20200605111551000007 messages Applied
20200605111551000008 messages Applied
20200605111551000009 messages Applied
20200605111551000010 messages Applied
20200605111551000011 messages Applied
20200607165100000000 settings Applied
20200607165100000001 settings Applied
20200607165100000002 settings Applied
20200607165100000003 settings Applied
20200607165100000004 settings Applied
20200705105359000000 rename_identities_schema Applied
20200810141652000000 flow_type Applied
20200810141652000001 flow_type Applied
20200810141652000002 flow_type Applied
20200810141652000003 flow_type Applied
20200810141652000004 flow_type Applied
20200810141652000005 flow_type Applied
20200810141652000006 flow_type Applied
20200810141652000007 flow_type Applied
20200810141652000008 flow_type Applied
20200810141652000009 flow_type Applied
20200810141652000010 flow_type Applied
20200810141652000011 flow_type Applied
20200810141652000012 flow_type Applied
20200810141652000013 flow_type Applied
20200810141652000014 flow_type Applied
20200810141652000015 flow_type Applied
20200810141652000016 flow_type Applied
20200810141652000017 flow_type Applied
20200810141652000018 flow_type Applied
20200810141652000019 flow_type Applied
20200810161022000000 flow_rename Applied
20200810161022000001 flow_rename Applied
20200810161022000002 flow_rename Applied
20200810161022000003 flow_rename Applied
20200810161022000004 flow_rename Applied
20200810161022000005 flow_rename Applied
20200810161022000006 flow_rename Applied
20200810161022000007 flow_rename Applied
20200810161022000008 flow_rename Applied
20200810162450000000 flow_fields_rename Applied
20200810162450000001 flow_fields_rename Applied
20200810162450000002 flow_fields_rename Applied
20200810162450000003 flow_fields_rename Applied
20200812124254000000 add_session_token Applied
20200812124254000001 add_session_token Applied
20200812124254000002 add_session_token Applied
20200812124254000003 add_session_token Applied
20200812124254000004 add_session_token Applied
20200812124254000005 add_session_token Applied
20200812124254000006 add_session_token Applied
20200812124254000007 add_session_token Applied
20200812160551000000 add_session_revoke Applied
20200812160551000001 add_session_revoke Applied
20200812160551000002 add_session_revoke Applied
20200812160551000003 add_session_revoke Applied
20200812160551000004 add_session_revoke Applied
20200812160551000005 add_session_revoke Applied
20200812160551000006 add_session_revoke Applied
20200812160551000007 add_session_revoke Applied
20200830121710000000 update_recovery_token Applied
20200830130642000000 add_verification_methods Applied
20200830130642000001 add_verification_methods Applied
20200830130642000002 add_verification_methods Applied
20200830130642000003 add_verification_methods Applied
20200830130642000004 add_verification_methods Applied
20200830130642000005 add_verification_methods Applied
20200830130642000006 add_verification_methods Applied
20200830130642000007 add_verification_methods Applied
20200830130642000008 add_verification_methods Applied
20200830130642000009 add_verification_methods Applied
20200830130642000010 add_verification_methods Applied
20200830130643000000 add_verification_methods Applied
20200830130644000000 add_verification_methods Applied
20200830130644000001 add_verification_methods Applied
20200830130645000000 add_verification_methods Applied
20200830130646000000 add_verification_methods Applied
20200830130646000001 add_verification_methods Applied
20200830130646000002 add_verification_methods Applied
20200830130646000003 add_verification_methods Applied
20200830130646000004 add_verification_methods Applied
20200830130646000005 add_verification_methods Applied
20200830130646000006 add_verification_methods Applied
20200830130646000007 add_verification_methods Applied
20200830130646000008 add_verification_methods Applied
20200830130646000009 add_verification_methods Applied
20200830130646000010 add_verification_methods Applied
20200830130646000011 add_verification_methods Applied
20200830154602000000 add_verification_token Applied
20200830154602000001 add_verification_token Applied
20200830154602000002 add_verification_token Applied
20200830154602000003 add_verification_token Applied
20200830154602000004 add_verification_token Applied
20200830172221000000 recovery_token_expires Applied
20200830172221000001 recovery_token_expires Applied
20200830172221000002 recovery_token_expires Applied
20200830172221000003 recovery_token_expires Applied
20200830172221000004 recovery_token_expires Applied
20200830172221000005 recovery_token_expires Applied
20200830172221000006 recovery_token_expires Applied
20200830172221000007 recovery_token_expires Applied
20200830172221000008 recovery_token_expires Applied
20200830172221000009 recovery_token_expires Applied
20200830172221000010 recovery_token_expires Applied
20200830172221000011 recovery_token_expires Applied
20200830172221000012 recovery_token_expires Applied
20200830172221000013 recovery_token_expires Applied
20200830172221000014 recovery_token_expires Applied
20200830172221000015 recovery_token_expires Applied
20200830172221000016 recovery_token_expires Applied
20200830172221000017 recovery_token_expires Applied
20200830172221000018 recovery_token_expires Applied
20200830172221000019 recovery_token_expires Applied
20200830172221000020 recovery_token_expires Applied
20200830172221000021 recovery_token_expires Applied
20200830172221000022 recovery_token_expires Applied
20200830172221000023 recovery_token_expires Applied
20200830172221000024 recovery_token_expires Applied
20200831110752000000 identity_verifiable_address_remove_code Applied
20200831110752000001 identity_verifiable_address_remove_code Applied
20200831110752000002 identity_verifiable_address_remove_code Applied
20200831110752000003 identity_verifiable_address_remove_code Applied
20200831110752000004 identity_verifiable_address_remove_code Applied
20200831110752000005 identity_verifiable_address_remove_code Applied
20200831110752000006 identity_verifiable_address_remove_code Applied
20200831110752000007 identity_verifiable_address_remove_code Applied
20200831110752000008 identity_verifiable_address_remove_code Applied
20200831110752000009 identity_verifiable_address_remove_code Applied
20200831110752000010 identity_verifiable_address_remove_code Applied
20200831110752000011 identity_verifiable_address_remove_code Applied
20200831110752000012 identity_verifiable_address_remove_code Applied
20200831110752000013 identity_verifiable_address_remove_code Applied
20200831110752000014 identity_verifiable_address_remove_code Applied
20200831110752000015 identity_verifiable_address_remove_code Applied
20200831110752000016 identity_verifiable_address_remove_code Applied
20200831110752000017 identity_verifiable_address_remove_code Applied
20200831110752000018 identity_verifiable_address_remove_code Applied
20200831110752000019 identity_verifiable_address_remove_code Applied
20200831110752000020 identity_verifiable_address_remove_code Rollback
20200831110752000021 identity_verifiable_address_remove_code Rollback
20201201161451000000 credential_types_values Rollback
20201201161451000001 credential_types_values Rollback
The SQL statements to be executed from top to bottom are:
------------ 20201201161451000001 - credential_types_values ------------
------------ 20201201161451000000 - credential_types_values ------------
DELETE FROM identity_credential_types WHERE name = 'password' OR name = 'oidc';
------------ 20200831110752000021 - identity_verifiable_address_remove_code ------------
ALTER TABLE "identity_verifiable_addresses" ADD COLUMN "code" TEXT
------------ 20200831110752000020 - identity_verifiable_address_remove_code ------------
ALTER TABLE "identity_verifiable_addresses" ADD COLUMN "expires_at" DATETIME
------------ SUCCESS ------------
Successfully applied migrations!
stderr:

View File

@@ -0,0 +1,225 @@
stdout: The migration plan is as follows:
Version Name Status
20191100000001000000 identities Applied
20191100000001000001 identities Applied
20191100000001000002 identities Applied
20191100000001000003 identities Applied
20191100000001000004 identities Applied
20191100000001000005 identities Applied
20191100000002000000 requests Applied
20191100000002000001 requests Applied
20191100000002000002 requests Applied
20191100000002000003 requests Applied
20191100000002000004 requests Applied
20191100000003000000 sessions Applied
20191100000004000000 errors Applied
20191100000006000000 courier Applied
20191100000007000000 errors Applied
20191100000007000001 errors Applied
20191100000007000002 errors Applied
20191100000007000003 errors Applied
20191100000008000000 selfservice_verification Applied
20191100000008000001 selfservice_verification Applied
20191100000008000002 selfservice_verification Applied
20191100000008000003 selfservice_verification Applied
20191100000008000004 selfservice_verification Applied
20191100000008000005 selfservice_verification Applied
20191100000010000000 errors Applied
20191100000010000001 errors Applied
20191100000010000002 errors Applied
20191100000010000003 errors Applied
20191100000010000004 errors Applied
20191100000011000000 courier_body_type Applied
20191100000011000001 courier_body_type Applied
20191100000011000002 courier_body_type Applied
20191100000011000003 courier_body_type Applied
20191100000012000000 login_request_forced Applied
20191100000012000001 login_request_forced Applied
20191100000012000002 login_request_forced Applied
20191100000012000003 login_request_forced Applied
20200317160354000000 create_profile_request_forms Applied
20200317160354000001 create_profile_request_forms Applied
20200317160354000002 create_profile_request_forms Applied
20200317160354000003 create_profile_request_forms Applied
20200317160354000004 create_profile_request_forms Applied
20200317160354000005 create_profile_request_forms Applied
20200317160354000006 create_profile_request_forms Applied
20200401183443000000 continuity_containers Applied
20200402142539000000 rename_profile_flows Applied
20200402142539000001 rename_profile_flows Applied
20200402142539000002 rename_profile_flows Applied
20200519101057000000 create_recovery_addresses Applied
20200519101057000001 create_recovery_addresses Applied
20200519101057000002 create_recovery_addresses Applied
20200519101057000003 create_recovery_addresses Applied
20200519101057000004 create_recovery_addresses Applied
20200519101057000005 create_recovery_addresses Applied
20200519101057000006 create_recovery_addresses Applied
20200519101057000007 create_recovery_addresses Applied
20200601101000000000 create_messages Applied
20200601101000000001 create_messages Applied
20200601101000000002 create_messages Applied
20200601101000000003 create_messages Applied
20200605111551000000 messages Applied
20200605111551000001 messages Applied
20200605111551000002 messages Applied
20200605111551000003 messages Applied
20200605111551000004 messages Applied
20200605111551000005 messages Applied
20200605111551000006 messages Applied
20200605111551000007 messages Applied
20200605111551000008 messages Applied
20200605111551000009 messages Applied
20200605111551000010 messages Applied
20200605111551000011 messages Applied
20200607165100000000 settings Applied
20200607165100000001 settings Applied
20200607165100000002 settings Applied
20200607165100000003 settings Applied
20200607165100000004 settings Applied
20200705105359000000 rename_identities_schema Applied
20200810141652000000 flow_type Applied
20200810141652000001 flow_type Applied
20200810141652000002 flow_type Applied
20200810141652000003 flow_type Applied
20200810141652000004 flow_type Applied
20200810141652000005 flow_type Applied
20200810141652000006 flow_type Applied
20200810141652000007 flow_type Applied
20200810141652000008 flow_type Applied
20200810141652000009 flow_type Applied
20200810141652000010 flow_type Applied
20200810141652000011 flow_type Applied
20200810141652000012 flow_type Applied
20200810141652000013 flow_type Applied
20200810141652000014 flow_type Applied
20200810141652000015 flow_type Applied
20200810141652000016 flow_type Applied
20200810141652000017 flow_type Applied
20200810141652000018 flow_type Applied
20200810141652000019 flow_type Applied
20200810161022000000 flow_rename Applied
20200810161022000001 flow_rename Applied
20200810161022000002 flow_rename Applied
20200810161022000003 flow_rename Applied
20200810161022000004 flow_rename Applied
20200810161022000005 flow_rename Applied
20200810161022000006 flow_rename Applied
20200810161022000007 flow_rename Applied
20200810161022000008 flow_rename Applied
20200810162450000000 flow_fields_rename Applied
20200810162450000001 flow_fields_rename Applied
20200810162450000002 flow_fields_rename Applied
20200810162450000003 flow_fields_rename Applied
20200812124254000000 add_session_token Applied
20200812124254000001 add_session_token Applied
20200812124254000002 add_session_token Applied
20200812124254000003 add_session_token Applied
20200812124254000004 add_session_token Applied
20200812124254000005 add_session_token Applied
20200812124254000006 add_session_token Applied
20200812124254000007 add_session_token Applied
20200812160551000000 add_session_revoke Applied
20200812160551000001 add_session_revoke Applied
20200812160551000002 add_session_revoke Applied
20200812160551000003 add_session_revoke Applied
20200812160551000004 add_session_revoke Applied
20200812160551000005 add_session_revoke Applied
20200812160551000006 add_session_revoke Applied
20200812160551000007 add_session_revoke Applied
20200830121710000000 update_recovery_token Applied
20200830130642000000 add_verification_methods Applied
20200830130642000001 add_verification_methods Applied
20200830130642000002 add_verification_methods Applied
20200830130642000003 add_verification_methods Applied
20200830130642000004 add_verification_methods Applied
20200830130642000005 add_verification_methods Applied
20200830130642000006 add_verification_methods Applied
20200830130642000007 add_verification_methods Applied
20200830130642000008 add_verification_methods Applied
20200830130642000009 add_verification_methods Applied
20200830130642000010 add_verification_methods Applied
20200830130643000000 add_verification_methods Applied
20200830130644000000 add_verification_methods Applied
20200830130644000001 add_verification_methods Applied
20200830130645000000 add_verification_methods Applied
20200830130646000000 add_verification_methods Applied
20200830130646000001 add_verification_methods Applied
20200830130646000002 add_verification_methods Applied
20200830130646000003 add_verification_methods Applied
20200830130646000004 add_verification_methods Applied
20200830130646000005 add_verification_methods Applied
20200830130646000006 add_verification_methods Applied
20200830130646000007 add_verification_methods Applied
20200830130646000008 add_verification_methods Applied
20200830130646000009 add_verification_methods Applied
20200830130646000010 add_verification_methods Applied
20200830130646000011 add_verification_methods Applied
20200830154602000000 add_verification_token Applied
20200830154602000001 add_verification_token Applied
20200830154602000002 add_verification_token Applied
20200830154602000003 add_verification_token Applied
20200830154602000004 add_verification_token Applied
20200830172221000000 recovery_token_expires Applied
20200830172221000001 recovery_token_expires Applied
20200830172221000002 recovery_token_expires Applied
20200830172221000003 recovery_token_expires Applied
20200830172221000004 recovery_token_expires Applied
20200830172221000005 recovery_token_expires Applied
20200830172221000006 recovery_token_expires Applied
20200830172221000007 recovery_token_expires Applied
20200830172221000008 recovery_token_expires Applied
20200830172221000009 recovery_token_expires Applied
20200830172221000010 recovery_token_expires Applied
20200830172221000011 recovery_token_expires Applied
20200830172221000012 recovery_token_expires Applied
20200830172221000013 recovery_token_expires Applied
20200830172221000014 recovery_token_expires Applied
20200830172221000015 recovery_token_expires Applied
20200830172221000016 recovery_token_expires Applied
20200830172221000017 recovery_token_expires Applied
20200830172221000018 recovery_token_expires Applied
20200830172221000019 recovery_token_expires Applied
20200830172221000020 recovery_token_expires Applied
20200830172221000021 recovery_token_expires Applied
20200830172221000022 recovery_token_expires Applied
20200830172221000023 recovery_token_expires Applied
20200830172221000024 recovery_token_expires Applied
20200831110752000000 identity_verifiable_address_remove_code Applied
20200831110752000001 identity_verifiable_address_remove_code Applied
20200831110752000002 identity_verifiable_address_remove_code Applied
20200831110752000003 identity_verifiable_address_remove_code Applied
20200831110752000004 identity_verifiable_address_remove_code Applied
20200831110752000005 identity_verifiable_address_remove_code Applied
20200831110752000006 identity_verifiable_address_remove_code Applied
20200831110752000007 identity_verifiable_address_remove_code Applied
20200831110752000008 identity_verifiable_address_remove_code Applied
20200831110752000009 identity_verifiable_address_remove_code Applied
20200831110752000010 identity_verifiable_address_remove_code Applied
20200831110752000011 identity_verifiable_address_remove_code Applied
20200831110752000012 identity_verifiable_address_remove_code Applied
20200831110752000013 identity_verifiable_address_remove_code Applied
20200831110752000014 identity_verifiable_address_remove_code Applied
20200831110752000015 identity_verifiable_address_remove_code Applied
20200831110752000016 identity_verifiable_address_remove_code Applied
20200831110752000017 identity_verifiable_address_remove_code Applied
20200831110752000018 identity_verifiable_address_remove_code Rollback
20200831110752000019 identity_verifiable_address_remove_code Rollback
20200831110752000020 identity_verifiable_address_remove_code Pending
20200831110752000021 identity_verifiable_address_remove_code Pending
20201201161451000000 credential_types_values Pending
20201201161451000001 credential_types_values Pending
The SQL statements to be executed from top to bottom are:
------------ 20200831110752000019 - identity_verifiable_address_remove_code ------------
UPDATE identity_verifiable_addresses SET code = substr(hex(randomblob(32)), 0, 32) WHERE code IS NULL
------------ 20200831110752000018 - identity_verifiable_address_remove_code ------------
UPDATE identity_verifiable_addresses SET expires_at = CURRENT_TIMESTAMP WHERE expires_at IS NULL
Do you wish to execute this migration plan? [y/n]: ------------ SUCCESS ------------
Successfully applied migrations!
stderr: To skip the next question use flag --yes (at your own risk).

View File

@@ -0,0 +1,237 @@
stdout: The migration plan is as follows:
Version Name Status
20191100000001000000 identities Applied
20191100000001000001 identities Applied
20191100000001000002 identities Applied
20191100000001000003 identities Applied
20191100000001000004 identities Applied
20191100000001000005 identities Applied
20191100000002000000 requests Applied
20191100000002000001 requests Applied
20191100000002000002 requests Applied
20191100000002000003 requests Applied
20191100000002000004 requests Applied
20191100000003000000 sessions Applied
20191100000004000000 errors Applied
20191100000006000000 courier Applied
20191100000007000000 errors Applied
20191100000007000001 errors Applied
20191100000007000002 errors Applied
20191100000007000003 errors Applied
20191100000008000000 selfservice_verification Applied
20191100000008000001 selfservice_verification Applied
20191100000008000002 selfservice_verification Applied
20191100000008000003 selfservice_verification Applied
20191100000008000004 selfservice_verification Applied
20191100000008000005 selfservice_verification Applied
20191100000010000000 errors Applied
20191100000010000001 errors Applied
20191100000010000002 errors Applied
20191100000010000003 errors Applied
20191100000010000004 errors Applied
20191100000011000000 courier_body_type Applied
20191100000011000001 courier_body_type Applied
20191100000011000002 courier_body_type Applied
20191100000011000003 courier_body_type Applied
20191100000012000000 login_request_forced Applied
20191100000012000001 login_request_forced Applied
20191100000012000002 login_request_forced Applied
20191100000012000003 login_request_forced Applied
20200317160354000000 create_profile_request_forms Applied
20200317160354000001 create_profile_request_forms Applied
20200317160354000002 create_profile_request_forms Applied
20200317160354000003 create_profile_request_forms Applied
20200317160354000004 create_profile_request_forms Applied
20200317160354000005 create_profile_request_forms Applied
20200317160354000006 create_profile_request_forms Applied
20200401183443000000 continuity_containers Applied
20200402142539000000 rename_profile_flows Applied
20200402142539000001 rename_profile_flows Applied
20200402142539000002 rename_profile_flows Applied
20200519101057000000 create_recovery_addresses Applied
20200519101057000001 create_recovery_addresses Applied
20200519101057000002 create_recovery_addresses Applied
20200519101057000003 create_recovery_addresses Applied
20200519101057000004 create_recovery_addresses Applied
20200519101057000005 create_recovery_addresses Applied
20200519101057000006 create_recovery_addresses Applied
20200519101057000007 create_recovery_addresses Applied
20200601101000000000 create_messages Applied
20200601101000000001 create_messages Applied
20200601101000000002 create_messages Applied
20200601101000000003 create_messages Applied
20200605111551000000 messages Applied
20200605111551000001 messages Applied
20200605111551000002 messages Applied
20200605111551000003 messages Applied
20200605111551000004 messages Applied
20200605111551000005 messages Applied
20200605111551000006 messages Applied
20200605111551000007 messages Applied
20200605111551000008 messages Applied
20200605111551000009 messages Applied
20200605111551000010 messages Applied
20200605111551000011 messages Applied
20200607165100000000 settings Applied
20200607165100000001 settings Applied
20200607165100000002 settings Applied
20200607165100000003 settings Applied
20200607165100000004 settings Applied
20200705105359000000 rename_identities_schema Applied
20200810141652000000 flow_type Applied
20200810141652000001 flow_type Applied
20200810141652000002 flow_type Applied
20200810141652000003 flow_type Applied
20200810141652000004 flow_type Applied
20200810141652000005 flow_type Applied
20200810141652000006 flow_type Applied
20200810141652000007 flow_type Applied
20200810141652000008 flow_type Applied
20200810141652000009 flow_type Applied
20200810141652000010 flow_type Applied
20200810141652000011 flow_type Applied
20200810141652000012 flow_type Applied
20200810141652000013 flow_type Applied
20200810141652000014 flow_type Applied
20200810141652000015 flow_type Applied
20200810141652000016 flow_type Applied
20200810141652000017 flow_type Applied
20200810141652000018 flow_type Applied
20200810141652000019 flow_type Applied
20200810161022000000 flow_rename Applied
20200810161022000001 flow_rename Applied
20200810161022000002 flow_rename Applied
20200810161022000003 flow_rename Applied
20200810161022000004 flow_rename Applied
20200810161022000005 flow_rename Applied
20200810161022000006 flow_rename Applied
20200810161022000007 flow_rename Applied
20200810161022000008 flow_rename Applied
20200810162450000000 flow_fields_rename Applied
20200810162450000001 flow_fields_rename Applied
20200810162450000002 flow_fields_rename Applied
20200810162450000003 flow_fields_rename Applied
20200812124254000000 add_session_token Applied
20200812124254000001 add_session_token Applied
20200812124254000002 add_session_token Applied
20200812124254000003 add_session_token Applied
20200812124254000004 add_session_token Applied
20200812124254000005 add_session_token Applied
20200812124254000006 add_session_token Applied
20200812124254000007 add_session_token Applied
20200812160551000000 add_session_revoke Applied
20200812160551000001 add_session_revoke Applied
20200812160551000002 add_session_revoke Applied
20200812160551000003 add_session_revoke Applied
20200812160551000004 add_session_revoke Applied
20200812160551000005 add_session_revoke Applied
20200812160551000006 add_session_revoke Applied
20200812160551000007 add_session_revoke Applied
20200830121710000000 update_recovery_token Applied
20200830130642000000 add_verification_methods Applied
20200830130642000001 add_verification_methods Applied
20200830130642000002 add_verification_methods Applied
20200830130642000003 add_verification_methods Applied
20200830130642000004 add_verification_methods Applied
20200830130642000005 add_verification_methods Applied
20200830130642000006 add_verification_methods Applied
20200830130642000007 add_verification_methods Applied
20200830130642000008 add_verification_methods Applied
20200830130642000009 add_verification_methods Applied
20200830130642000010 add_verification_methods Applied
20200830130643000000 add_verification_methods Applied
20200830130644000000 add_verification_methods Applied
20200830130644000001 add_verification_methods Applied
20200830130645000000 add_verification_methods Applied
20200830130646000000 add_verification_methods Applied
20200830130646000001 add_verification_methods Applied
20200830130646000002 add_verification_methods Applied
20200830130646000003 add_verification_methods Applied
20200830130646000004 add_verification_methods Applied
20200830130646000005 add_verification_methods Applied
20200830130646000006 add_verification_methods Applied
20200830130646000007 add_verification_methods Applied
20200830130646000008 add_verification_methods Applied
20200830130646000009 add_verification_methods Applied
20200830130646000010 add_verification_methods Applied
20200830130646000011 add_verification_methods Applied
20200830154602000000 add_verification_token Applied
20200830154602000001 add_verification_token Applied
20200830154602000002 add_verification_token Applied
20200830154602000003 add_verification_token Applied
20200830154602000004 add_verification_token Applied
20200830172221000000 recovery_token_expires Applied
20200830172221000001 recovery_token_expires Applied
20200830172221000002 recovery_token_expires Applied
20200830172221000003 recovery_token_expires Applied
20200830172221000004 recovery_token_expires Applied
20200830172221000005 recovery_token_expires Applied
20200830172221000006 recovery_token_expires Applied
20200830172221000007 recovery_token_expires Applied
20200830172221000008 recovery_token_expires Applied
20200830172221000009 recovery_token_expires Applied
20200830172221000010 recovery_token_expires Applied
20200830172221000011 recovery_token_expires Applied
20200830172221000012 recovery_token_expires Applied
20200830172221000013 recovery_token_expires Applied
20200830172221000014 recovery_token_expires Applied
20200830172221000015 recovery_token_expires Applied
20200830172221000016 recovery_token_expires Applied
20200830172221000017 recovery_token_expires Applied
20200830172221000018 recovery_token_expires Applied
20200830172221000019 recovery_token_expires Applied
20200830172221000020 recovery_token_expires Applied
20200830172221000021 recovery_token_expires Applied
20200830172221000022 recovery_token_expires Applied
20200830172221000023 recovery_token_expires Applied
20200830172221000024 recovery_token_expires Applied
20200831110752000000 identity_verifiable_address_remove_code Applied
20200831110752000001 identity_verifiable_address_remove_code Applied
20200831110752000002 identity_verifiable_address_remove_code Applied
20200831110752000003 identity_verifiable_address_remove_code Applied
20200831110752000004 identity_verifiable_address_remove_code Applied
20200831110752000005 identity_verifiable_address_remove_code Applied
20200831110752000006 identity_verifiable_address_remove_code Applied
20200831110752000007 identity_verifiable_address_remove_code Applied
20200831110752000008 identity_verifiable_address_remove_code Applied
20200831110752000009 identity_verifiable_address_remove_code Applied
20200831110752000010 identity_verifiable_address_remove_code Applied
20200831110752000011 identity_verifiable_address_remove_code Applied
20200831110752000012 identity_verifiable_address_remove_code Applied
20200831110752000013 identity_verifiable_address_remove_code Applied
20200831110752000014 identity_verifiable_address_remove_code Applied
20200831110752000015 identity_verifiable_address_remove_code Applied
20200831110752000016 identity_verifiable_address_remove_code Applied
20200831110752000017 identity_verifiable_address_remove_code Applied
20200831110752000018 identity_verifiable_address_remove_code Pending
20200831110752000019 identity_verifiable_address_remove_code Pending
20200831110752000020 identity_verifiable_address_remove_code Pending
20200831110752000021 identity_verifiable_address_remove_code Pending
20201201161451000000 credential_types_values Pending
20201201161451000001 credential_types_values Pending
The SQL statements to be executed from top to bottom are:
------------ 20200831110752000018 - identity_verifiable_address_remove_code ------------
------------ 20200831110752000019 - identity_verifiable_address_remove_code ------------
------------ 20200831110752000020 - identity_verifiable_address_remove_code ------------
------------ 20200831110752000021 - identity_verifiable_address_remove_code ------------
------------ 20201201161451000000 - credential_types_values ------------
INSERT INTO identity_credential_types (id, name) SELECT '78c1b41d-8341-4507-aa60-aff1d4369670', 'password' WHERE NOT EXISTS ( SELECT * FROM identity_credential_types WHERE name = 'password')
------------ 20201201161451000001 - credential_types_values ------------
INSERT INTO identity_credential_types (id, name) SELECT '6fa5e2e0-bfce-4631-b62b-cf2b0252b289', 'oidc' WHERE NOT EXISTS ( SELECT * FROM identity_credential_types WHERE name = 'oidc');
Do you wish to execute this migration plan? [y/n]: ------------ SUCCESS ------------
Successfully applied migrations!
stderr: To skip the next question use flag --yes (at your own risk).

View File

@@ -0,0 +1,219 @@
stdout: The migration plan is as follows:
Version Name Status
20191100000001000000 identities Applied
20191100000001000001 identities Applied
20191100000001000002 identities Applied
20191100000001000003 identities Applied
20191100000001000004 identities Applied
20191100000001000005 identities Applied
20191100000002000000 requests Applied
20191100000002000001 requests Applied
20191100000002000002 requests Applied
20191100000002000003 requests Applied
20191100000002000004 requests Applied
20191100000003000000 sessions Applied
20191100000004000000 errors Applied
20191100000006000000 courier Applied
20191100000007000000 errors Applied
20191100000007000001 errors Applied
20191100000007000002 errors Applied
20191100000007000003 errors Applied
20191100000008000000 selfservice_verification Applied
20191100000008000001 selfservice_verification Applied
20191100000008000002 selfservice_verification Applied
20191100000008000003 selfservice_verification Applied
20191100000008000004 selfservice_verification Applied
20191100000008000005 selfservice_verification Applied
20191100000010000000 errors Applied
20191100000010000001 errors Applied
20191100000010000002 errors Applied
20191100000010000003 errors Applied
20191100000010000004 errors Applied
20191100000011000000 courier_body_type Applied
20191100000011000001 courier_body_type Applied
20191100000011000002 courier_body_type Applied
20191100000011000003 courier_body_type Applied
20191100000012000000 login_request_forced Applied
20191100000012000001 login_request_forced Applied
20191100000012000002 login_request_forced Applied
20191100000012000003 login_request_forced Applied
20200317160354000000 create_profile_request_forms Applied
20200317160354000001 create_profile_request_forms Applied
20200317160354000002 create_profile_request_forms Applied
20200317160354000003 create_profile_request_forms Applied
20200317160354000004 create_profile_request_forms Applied
20200317160354000005 create_profile_request_forms Applied
20200317160354000006 create_profile_request_forms Applied
20200401183443000000 continuity_containers Applied
20200402142539000000 rename_profile_flows Applied
20200402142539000001 rename_profile_flows Applied
20200402142539000002 rename_profile_flows Applied
20200519101057000000 create_recovery_addresses Applied
20200519101057000001 create_recovery_addresses Applied
20200519101057000002 create_recovery_addresses Applied
20200519101057000003 create_recovery_addresses Applied
20200519101057000004 create_recovery_addresses Applied
20200519101057000005 create_recovery_addresses Applied
20200519101057000006 create_recovery_addresses Applied
20200519101057000007 create_recovery_addresses Applied
20200601101000000000 create_messages Applied
20200601101000000001 create_messages Applied
20200601101000000002 create_messages Applied
20200601101000000003 create_messages Applied
20200605111551000000 messages Applied
20200605111551000001 messages Applied
20200605111551000002 messages Applied
20200605111551000003 messages Applied
20200605111551000004 messages Applied
20200605111551000005 messages Applied
20200605111551000006 messages Applied
20200605111551000007 messages Applied
20200605111551000008 messages Applied
20200605111551000009 messages Applied
20200605111551000010 messages Applied
20200605111551000011 messages Applied
20200607165100000000 settings Applied
20200607165100000001 settings Applied
20200607165100000002 settings Applied
20200607165100000003 settings Applied
20200607165100000004 settings Applied
20200705105359000000 rename_identities_schema Applied
20200810141652000000 flow_type Applied
20200810141652000001 flow_type Applied
20200810141652000002 flow_type Applied
20200810141652000003 flow_type Applied
20200810141652000004 flow_type Applied
20200810141652000005 flow_type Applied
20200810141652000006 flow_type Applied
20200810141652000007 flow_type Applied
20200810141652000008 flow_type Applied
20200810141652000009 flow_type Applied
20200810141652000010 flow_type Applied
20200810141652000011 flow_type Applied
20200810141652000012 flow_type Applied
20200810141652000013 flow_type Applied
20200810141652000014 flow_type Applied
20200810141652000015 flow_type Applied
20200810141652000016 flow_type Applied
20200810141652000017 flow_type Applied
20200810141652000018 flow_type Applied
20200810141652000019 flow_type Applied
20200810161022000000 flow_rename Applied
20200810161022000001 flow_rename Applied
20200810161022000002 flow_rename Applied
20200810161022000003 flow_rename Applied
20200810161022000004 flow_rename Applied
20200810161022000005 flow_rename Applied
20200810161022000006 flow_rename Applied
20200810161022000007 flow_rename Applied
20200810161022000008 flow_rename Applied
20200810162450000000 flow_fields_rename Applied
20200810162450000001 flow_fields_rename Applied
20200810162450000002 flow_fields_rename Applied
20200810162450000003 flow_fields_rename Applied
20200812124254000000 add_session_token Applied
20200812124254000001 add_session_token Applied
20200812124254000002 add_session_token Applied
20200812124254000003 add_session_token Applied
20200812124254000004 add_session_token Applied
20200812124254000005 add_session_token Applied
20200812124254000006 add_session_token Applied
20200812124254000007 add_session_token Applied
20200812160551000000 add_session_revoke Applied
20200812160551000001 add_session_revoke Applied
20200812160551000002 add_session_revoke Applied
20200812160551000003 add_session_revoke Applied
20200812160551000004 add_session_revoke Applied
20200812160551000005 add_session_revoke Applied
20200812160551000006 add_session_revoke Applied
20200812160551000007 add_session_revoke Applied
20200830121710000000 update_recovery_token Applied
20200830130642000000 add_verification_methods Applied
20200830130642000001 add_verification_methods Applied
20200830130642000002 add_verification_methods Applied
20200830130642000003 add_verification_methods Applied
20200830130642000004 add_verification_methods Applied
20200830130642000005 add_verification_methods Applied
20200830130642000006 add_verification_methods Applied
20200830130642000007 add_verification_methods Applied
20200830130642000008 add_verification_methods Applied
20200830130642000009 add_verification_methods Applied
20200830130642000010 add_verification_methods Applied
20200830130643000000 add_verification_methods Applied
20200830130644000000 add_verification_methods Applied
20200830130644000001 add_verification_methods Applied
20200830130645000000 add_verification_methods Applied
20200830130646000000 add_verification_methods Applied
20200830130646000001 add_verification_methods Applied
20200830130646000002 add_verification_methods Applied
20200830130646000003 add_verification_methods Applied
20200830130646000004 add_verification_methods Applied
20200830130646000005 add_verification_methods Applied
20200830130646000006 add_verification_methods Applied
20200830130646000007 add_verification_methods Applied
20200830130646000008 add_verification_methods Applied
20200830130646000009 add_verification_methods Applied
20200830130646000010 add_verification_methods Applied
20200830130646000011 add_verification_methods Applied
20200830154602000000 add_verification_token Applied
20200830154602000001 add_verification_token Applied
20200830154602000002 add_verification_token Applied
20200830154602000003 add_verification_token Applied
20200830154602000004 add_verification_token Applied
20200830172221000000 recovery_token_expires Applied
20200830172221000001 recovery_token_expires Applied
20200830172221000002 recovery_token_expires Applied
20200830172221000003 recovery_token_expires Applied
20200830172221000004 recovery_token_expires Applied
20200830172221000005 recovery_token_expires Applied
20200830172221000006 recovery_token_expires Applied
20200830172221000007 recovery_token_expires Applied
20200830172221000008 recovery_token_expires Applied
20200830172221000009 recovery_token_expires Applied
20200830172221000010 recovery_token_expires Applied
20200830172221000011 recovery_token_expires Applied
20200830172221000012 recovery_token_expires Applied
20200830172221000013 recovery_token_expires Applied
20200830172221000014 recovery_token_expires Applied
20200830172221000015 recovery_token_expires Applied
20200830172221000016 recovery_token_expires Applied
20200830172221000017 recovery_token_expires Applied
20200830172221000018 recovery_token_expires Applied
20200830172221000019 recovery_token_expires Applied
20200830172221000020 recovery_token_expires Applied
20200830172221000021 recovery_token_expires Applied
20200830172221000022 recovery_token_expires Applied
20200830172221000023 recovery_token_expires Applied
20200830172221000024 recovery_token_expires Applied
20200831110752000000 identity_verifiable_address_remove_code Applied
20200831110752000001 identity_verifiable_address_remove_code Applied
20200831110752000002 identity_verifiable_address_remove_code Applied
20200831110752000003 identity_verifiable_address_remove_code Applied
20200831110752000004 identity_verifiable_address_remove_code Applied
20200831110752000005 identity_verifiable_address_remove_code Applied
20200831110752000006 identity_verifiable_address_remove_code Applied
20200831110752000007 identity_verifiable_address_remove_code Applied
20200831110752000008 identity_verifiable_address_remove_code Applied
20200831110752000009 identity_verifiable_address_remove_code Applied
20200831110752000010 identity_verifiable_address_remove_code Applied
20200831110752000011 identity_verifiable_address_remove_code Applied
20200831110752000012 identity_verifiable_address_remove_code Applied
20200831110752000013 identity_verifiable_address_remove_code Applied
20200831110752000014 identity_verifiable_address_remove_code Applied
20200831110752000015 identity_verifiable_address_remove_code Applied
20200831110752000016 identity_verifiable_address_remove_code Applied
20200831110752000017 identity_verifiable_address_remove_code Applied
20200831110752000018 identity_verifiable_address_remove_code Applied
20200831110752000019 identity_verifiable_address_remove_code Applied
20200831110752000020 identity_verifiable_address_remove_code Applied
20200831110752000021 identity_verifiable_address_remove_code Applied
20201201161451000000 credential_types_values Applied
20201201161451000001 credential_types_values Applied
The SQL statements to be executed from top to bottom are:
Do you wish to execute this migration plan? [y/n]: ------------ WARNING ------------
Migration aborted.
stderr: To skip the next question use flag --yes (at your own risk).

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,212 @@
stdout: Version Name Status
20191100000001000000 identities Applied
20191100000001000001 identities Applied
20191100000001000002 identities Applied
20191100000001000003 identities Applied
20191100000001000004 identities Applied
20191100000001000005 identities Applied
20191100000002000000 requests Applied
20191100000002000001 requests Applied
20191100000002000002 requests Applied
20191100000002000003 requests Applied
20191100000002000004 requests Applied
20191100000003000000 sessions Applied
20191100000004000000 errors Applied
20191100000006000000 courier Applied
20191100000007000000 errors Applied
20191100000007000001 errors Applied
20191100000007000002 errors Applied
20191100000007000003 errors Applied
20191100000008000000 selfservice_verification Applied
20191100000008000001 selfservice_verification Applied
20191100000008000002 selfservice_verification Applied
20191100000008000003 selfservice_verification Applied
20191100000008000004 selfservice_verification Applied
20191100000008000005 selfservice_verification Applied
20191100000010000000 errors Applied
20191100000010000001 errors Applied
20191100000010000002 errors Applied
20191100000010000003 errors Applied
20191100000010000004 errors Applied
20191100000011000000 courier_body_type Applied
20191100000011000001 courier_body_type Applied
20191100000011000002 courier_body_type Applied
20191100000011000003 courier_body_type Applied
20191100000012000000 login_request_forced Applied
20191100000012000001 login_request_forced Applied
20191100000012000002 login_request_forced Applied
20191100000012000003 login_request_forced Applied
20200317160354000000 create_profile_request_forms Applied
20200317160354000001 create_profile_request_forms Applied
20200317160354000002 create_profile_request_forms Applied
20200317160354000003 create_profile_request_forms Applied
20200317160354000004 create_profile_request_forms Applied
20200317160354000005 create_profile_request_forms Applied
20200317160354000006 create_profile_request_forms Applied
20200401183443000000 continuity_containers Applied
20200402142539000000 rename_profile_flows Applied
20200402142539000001 rename_profile_flows Applied
20200402142539000002 rename_profile_flows Applied
20200519101057000000 create_recovery_addresses Applied
20200519101057000001 create_recovery_addresses Applied
20200519101057000002 create_recovery_addresses Applied
20200519101057000003 create_recovery_addresses Applied
20200519101057000004 create_recovery_addresses Applied
20200519101057000005 create_recovery_addresses Applied
20200519101057000006 create_recovery_addresses Applied
20200519101057000007 create_recovery_addresses Applied
20200601101000000000 create_messages Applied
20200601101000000001 create_messages Applied
20200601101000000002 create_messages Applied
20200601101000000003 create_messages Applied
20200605111551000000 messages Applied
20200605111551000001 messages Applied
20200605111551000002 messages Applied
20200605111551000003 messages Applied
20200605111551000004 messages Applied
20200605111551000005 messages Applied
20200605111551000006 messages Applied
20200605111551000007 messages Applied
20200605111551000008 messages Applied
20200605111551000009 messages Applied
20200605111551000010 messages Applied
20200605111551000011 messages Applied
20200607165100000000 settings Applied
20200607165100000001 settings Applied
20200607165100000002 settings Applied
20200607165100000003 settings Applied
20200607165100000004 settings Applied
20200705105359000000 rename_identities_schema Applied
20200810141652000000 flow_type Applied
20200810141652000001 flow_type Applied
20200810141652000002 flow_type Applied
20200810141652000003 flow_type Applied
20200810141652000004 flow_type Applied
20200810141652000005 flow_type Applied
20200810141652000006 flow_type Applied
20200810141652000007 flow_type Applied
20200810141652000008 flow_type Applied
20200810141652000009 flow_type Applied
20200810141652000010 flow_type Applied
20200810141652000011 flow_type Applied
20200810141652000012 flow_type Applied
20200810141652000013 flow_type Applied
20200810141652000014 flow_type Applied
20200810141652000015 flow_type Applied
20200810141652000016 flow_type Applied
20200810141652000017 flow_type Applied
20200810141652000018 flow_type Applied
20200810141652000019 flow_type Applied
20200810161022000000 flow_rename Applied
20200810161022000001 flow_rename Applied
20200810161022000002 flow_rename Applied
20200810161022000003 flow_rename Applied
20200810161022000004 flow_rename Applied
20200810161022000005 flow_rename Applied
20200810161022000006 flow_rename Applied
20200810161022000007 flow_rename Applied
20200810161022000008 flow_rename Applied
20200810162450000000 flow_fields_rename Applied
20200810162450000001 flow_fields_rename Applied
20200810162450000002 flow_fields_rename Applied
20200810162450000003 flow_fields_rename Applied
20200812124254000000 add_session_token Applied
20200812124254000001 add_session_token Applied
20200812124254000002 add_session_token Applied
20200812124254000003 add_session_token Applied
20200812124254000004 add_session_token Applied
20200812124254000005 add_session_token Applied
20200812124254000006 add_session_token Applied
20200812124254000007 add_session_token Applied
20200812160551000000 add_session_revoke Applied
20200812160551000001 add_session_revoke Applied
20200812160551000002 add_session_revoke Applied
20200812160551000003 add_session_revoke Applied
20200812160551000004 add_session_revoke Applied
20200812160551000005 add_session_revoke Applied
20200812160551000006 add_session_revoke Applied
20200812160551000007 add_session_revoke Applied
20200830121710000000 update_recovery_token Applied
20200830130642000000 add_verification_methods Applied
20200830130642000001 add_verification_methods Applied
20200830130642000002 add_verification_methods Applied
20200830130642000003 add_verification_methods Applied
20200830130642000004 add_verification_methods Applied
20200830130642000005 add_verification_methods Applied
20200830130642000006 add_verification_methods Applied
20200830130642000007 add_verification_methods Applied
20200830130642000008 add_verification_methods Applied
20200830130642000009 add_verification_methods Applied
20200830130642000010 add_verification_methods Applied
20200830130643000000 add_verification_methods Applied
20200830130644000000 add_verification_methods Applied
20200830130644000001 add_verification_methods Applied
20200830130645000000 add_verification_methods Applied
20200830130646000000 add_verification_methods Applied
20200830130646000001 add_verification_methods Applied
20200830130646000002 add_verification_methods Applied
20200830130646000003 add_verification_methods Applied
20200830130646000004 add_verification_methods Applied
20200830130646000005 add_verification_methods Applied
20200830130646000006 add_verification_methods Applied
20200830130646000007 add_verification_methods Applied
20200830130646000008 add_verification_methods Applied
20200830130646000009 add_verification_methods Applied
20200830130646000010 add_verification_methods Applied
20200830130646000011 add_verification_methods Applied
20200830154602000000 add_verification_token Applied
20200830154602000001 add_verification_token Applied
20200830154602000002 add_verification_token Applied
20200830154602000003 add_verification_token Applied
20200830154602000004 add_verification_token Applied
20200830172221000000 recovery_token_expires Applied
20200830172221000001 recovery_token_expires Applied
20200830172221000002 recovery_token_expires Applied
20200830172221000003 recovery_token_expires Applied
20200830172221000004 recovery_token_expires Applied
20200830172221000005 recovery_token_expires Applied
20200830172221000006 recovery_token_expires Applied
20200830172221000007 recovery_token_expires Applied
20200830172221000008 recovery_token_expires Applied
20200830172221000009 recovery_token_expires Applied
20200830172221000010 recovery_token_expires Applied
20200830172221000011 recovery_token_expires Applied
20200830172221000012 recovery_token_expires Applied
20200830172221000013 recovery_token_expires Applied
20200830172221000014 recovery_token_expires Applied
20200830172221000015 recovery_token_expires Applied
20200830172221000016 recovery_token_expires Applied
20200830172221000017 recovery_token_expires Applied
20200830172221000018 recovery_token_expires Applied
20200830172221000019 recovery_token_expires Applied
20200830172221000020 recovery_token_expires Applied
20200830172221000021 recovery_token_expires Applied
20200830172221000022 recovery_token_expires Applied
20200830172221000023 recovery_token_expires Applied
20200830172221000024 recovery_token_expires Applied
20200831110752000000 identity_verifiable_address_remove_code Applied
20200831110752000001 identity_verifiable_address_remove_code Applied
20200831110752000002 identity_verifiable_address_remove_code Applied
20200831110752000003 identity_verifiable_address_remove_code Applied
20200831110752000004 identity_verifiable_address_remove_code Applied
20200831110752000005 identity_verifiable_address_remove_code Applied
20200831110752000006 identity_verifiable_address_remove_code Applied
20200831110752000007 identity_verifiable_address_remove_code Applied
20200831110752000008 identity_verifiable_address_remove_code Applied
20200831110752000009 identity_verifiable_address_remove_code Applied
20200831110752000010 identity_verifiable_address_remove_code Applied
20200831110752000011 identity_verifiable_address_remove_code Applied
20200831110752000012 identity_verifiable_address_remove_code Applied
20200831110752000013 identity_verifiable_address_remove_code Applied
20200831110752000014 identity_verifiable_address_remove_code Applied
20200831110752000015 identity_verifiable_address_remove_code Applied
20200831110752000016 identity_verifiable_address_remove_code Applied
20200831110752000017 identity_verifiable_address_remove_code Applied
20200831110752000018 identity_verifiable_address_remove_code Applied
20200831110752000019 identity_verifiable_address_remove_code Applied
20200831110752000020 identity_verifiable_address_remove_code Applied
20200831110752000021 identity_verifiable_address_remove_code Applied
20201201161451000000 credential_types_values Applied
20201201161451000001 credential_types_values Applied
stderr:

View File

@@ -0,0 +1,212 @@
stdout: Version Name Status
20191100000001000000 identities Pending
20191100000001000001 identities Pending
20191100000001000002 identities Pending
20191100000001000003 identities Pending
20191100000001000004 identities Pending
20191100000001000005 identities Pending
20191100000002000000 requests Pending
20191100000002000001 requests Pending
20191100000002000002 requests Pending
20191100000002000003 requests Pending
20191100000002000004 requests Pending
20191100000003000000 sessions Pending
20191100000004000000 errors Pending
20191100000006000000 courier Pending
20191100000007000000 errors Pending
20191100000007000001 errors Pending
20191100000007000002 errors Pending
20191100000007000003 errors Pending
20191100000008000000 selfservice_verification Pending
20191100000008000001 selfservice_verification Pending
20191100000008000002 selfservice_verification Pending
20191100000008000003 selfservice_verification Pending
20191100000008000004 selfservice_verification Pending
20191100000008000005 selfservice_verification Pending
20191100000010000000 errors Pending
20191100000010000001 errors Pending
20191100000010000002 errors Pending
20191100000010000003 errors Pending
20191100000010000004 errors Pending
20191100000011000000 courier_body_type Pending
20191100000011000001 courier_body_type Pending
20191100000011000002 courier_body_type Pending
20191100000011000003 courier_body_type Pending
20191100000012000000 login_request_forced Pending
20191100000012000001 login_request_forced Pending
20191100000012000002 login_request_forced Pending
20191100000012000003 login_request_forced Pending
20200317160354000000 create_profile_request_forms Pending
20200317160354000001 create_profile_request_forms Pending
20200317160354000002 create_profile_request_forms Pending
20200317160354000003 create_profile_request_forms Pending
20200317160354000004 create_profile_request_forms Pending
20200317160354000005 create_profile_request_forms Pending
20200317160354000006 create_profile_request_forms Pending
20200401183443000000 continuity_containers Pending
20200402142539000000 rename_profile_flows Pending
20200402142539000001 rename_profile_flows Pending
20200402142539000002 rename_profile_flows Pending
20200519101057000000 create_recovery_addresses Pending
20200519101057000001 create_recovery_addresses Pending
20200519101057000002 create_recovery_addresses Pending
20200519101057000003 create_recovery_addresses Pending
20200519101057000004 create_recovery_addresses Pending
20200519101057000005 create_recovery_addresses Pending
20200519101057000006 create_recovery_addresses Pending
20200519101057000007 create_recovery_addresses Pending
20200601101000000000 create_messages Pending
20200601101000000001 create_messages Pending
20200601101000000002 create_messages Pending
20200601101000000003 create_messages Pending
20200605111551000000 messages Pending
20200605111551000001 messages Pending
20200605111551000002 messages Pending
20200605111551000003 messages Pending
20200605111551000004 messages Pending
20200605111551000005 messages Pending
20200605111551000006 messages Pending
20200605111551000007 messages Pending
20200605111551000008 messages Pending
20200605111551000009 messages Pending
20200605111551000010 messages Pending
20200605111551000011 messages Pending
20200607165100000000 settings Pending
20200607165100000001 settings Pending
20200607165100000002 settings Pending
20200607165100000003 settings Pending
20200607165100000004 settings Pending
20200705105359000000 rename_identities_schema Pending
20200810141652000000 flow_type Pending
20200810141652000001 flow_type Pending
20200810141652000002 flow_type Pending
20200810141652000003 flow_type Pending
20200810141652000004 flow_type Pending
20200810141652000005 flow_type Pending
20200810141652000006 flow_type Pending
20200810141652000007 flow_type Pending
20200810141652000008 flow_type Pending
20200810141652000009 flow_type Pending
20200810141652000010 flow_type Pending
20200810141652000011 flow_type Pending
20200810141652000012 flow_type Pending
20200810141652000013 flow_type Pending
20200810141652000014 flow_type Pending
20200810141652000015 flow_type Pending
20200810141652000016 flow_type Pending
20200810141652000017 flow_type Pending
20200810141652000018 flow_type Pending
20200810141652000019 flow_type Pending
20200810161022000000 flow_rename Pending
20200810161022000001 flow_rename Pending
20200810161022000002 flow_rename Pending
20200810161022000003 flow_rename Pending
20200810161022000004 flow_rename Pending
20200810161022000005 flow_rename Pending
20200810161022000006 flow_rename Pending
20200810161022000007 flow_rename Pending
20200810161022000008 flow_rename Pending
20200810162450000000 flow_fields_rename Pending
20200810162450000001 flow_fields_rename Pending
20200810162450000002 flow_fields_rename Pending
20200810162450000003 flow_fields_rename Pending
20200812124254000000 add_session_token Pending
20200812124254000001 add_session_token Pending
20200812124254000002 add_session_token Pending
20200812124254000003 add_session_token Pending
20200812124254000004 add_session_token Pending
20200812124254000005 add_session_token Pending
20200812124254000006 add_session_token Pending
20200812124254000007 add_session_token Pending
20200812160551000000 add_session_revoke Pending
20200812160551000001 add_session_revoke Pending
20200812160551000002 add_session_revoke Pending
20200812160551000003 add_session_revoke Pending
20200812160551000004 add_session_revoke Pending
20200812160551000005 add_session_revoke Pending
20200812160551000006 add_session_revoke Pending
20200812160551000007 add_session_revoke Pending
20200830121710000000 update_recovery_token Pending
20200830130642000000 add_verification_methods Pending
20200830130642000001 add_verification_methods Pending
20200830130642000002 add_verification_methods Pending
20200830130642000003 add_verification_methods Pending
20200830130642000004 add_verification_methods Pending
20200830130642000005 add_verification_methods Pending
20200830130642000006 add_verification_methods Pending
20200830130642000007 add_verification_methods Pending
20200830130642000008 add_verification_methods Pending
20200830130642000009 add_verification_methods Pending
20200830130642000010 add_verification_methods Pending
20200830130643000000 add_verification_methods Pending
20200830130644000000 add_verification_methods Pending
20200830130644000001 add_verification_methods Pending
20200830130645000000 add_verification_methods Pending
20200830130646000000 add_verification_methods Pending
20200830130646000001 add_verification_methods Pending
20200830130646000002 add_verification_methods Pending
20200830130646000003 add_verification_methods Pending
20200830130646000004 add_verification_methods Pending
20200830130646000005 add_verification_methods Pending
20200830130646000006 add_verification_methods Pending
20200830130646000007 add_verification_methods Pending
20200830130646000008 add_verification_methods Pending
20200830130646000009 add_verification_methods Pending
20200830130646000010 add_verification_methods Pending
20200830130646000011 add_verification_methods Pending
20200830154602000000 add_verification_token Pending
20200830154602000001 add_verification_token Pending
20200830154602000002 add_verification_token Pending
20200830154602000003 add_verification_token Pending
20200830154602000004 add_verification_token Pending
20200830172221000000 recovery_token_expires Pending
20200830172221000001 recovery_token_expires Pending
20200830172221000002 recovery_token_expires Pending
20200830172221000003 recovery_token_expires Pending
20200830172221000004 recovery_token_expires Pending
20200830172221000005 recovery_token_expires Pending
20200830172221000006 recovery_token_expires Pending
20200830172221000007 recovery_token_expires Pending
20200830172221000008 recovery_token_expires Pending
20200830172221000009 recovery_token_expires Pending
20200830172221000010 recovery_token_expires Pending
20200830172221000011 recovery_token_expires Pending
20200830172221000012 recovery_token_expires Pending
20200830172221000013 recovery_token_expires Pending
20200830172221000014 recovery_token_expires Pending
20200830172221000015 recovery_token_expires Pending
20200830172221000016 recovery_token_expires Pending
20200830172221000017 recovery_token_expires Pending
20200830172221000018 recovery_token_expires Pending
20200830172221000019 recovery_token_expires Pending
20200830172221000020 recovery_token_expires Pending
20200830172221000021 recovery_token_expires Pending
20200830172221000022 recovery_token_expires Pending
20200830172221000023 recovery_token_expires Pending
20200830172221000024 recovery_token_expires Pending
20200831110752000000 identity_verifiable_address_remove_code Pending
20200831110752000001 identity_verifiable_address_remove_code Pending
20200831110752000002 identity_verifiable_address_remove_code Pending
20200831110752000003 identity_verifiable_address_remove_code Pending
20200831110752000004 identity_verifiable_address_remove_code Pending
20200831110752000005 identity_verifiable_address_remove_code Pending
20200831110752000006 identity_verifiable_address_remove_code Pending
20200831110752000007 identity_verifiable_address_remove_code Pending
20200831110752000008 identity_verifiable_address_remove_code Pending
20200831110752000009 identity_verifiable_address_remove_code Pending
20200831110752000010 identity_verifiable_address_remove_code Pending
20200831110752000011 identity_verifiable_address_remove_code Pending
20200831110752000012 identity_verifiable_address_remove_code Pending
20200831110752000013 identity_verifiable_address_remove_code Pending
20200831110752000014 identity_verifiable_address_remove_code Pending
20200831110752000015 identity_verifiable_address_remove_code Pending
20200831110752000016 identity_verifiable_address_remove_code Pending
20200831110752000017 identity_verifiable_address_remove_code Pending
20200831110752000018 identity_verifiable_address_remove_code Pending
20200831110752000019 identity_verifiable_address_remove_code Pending
20200831110752000020 identity_verifiable_address_remove_code Pending
20200831110752000021 identity_verifiable_address_remove_code Pending
20201201161451000000 credential_types_values Pending
20201201161451000001 credential_types_values Pending
stderr:

View File

@@ -0,0 +1,212 @@
stdout: Version Name Status
20191100000001000000 identities Applied
20191100000001000001 identities Applied
20191100000001000002 identities Applied
20191100000001000003 identities Applied
20191100000001000004 identities Applied
20191100000001000005 identities Applied
20191100000002000000 requests Applied
20191100000002000001 requests Applied
20191100000002000002 requests Applied
20191100000002000003 requests Applied
20191100000002000004 requests Applied
20191100000003000000 sessions Applied
20191100000004000000 errors Applied
20191100000006000000 courier Applied
20191100000007000000 errors Applied
20191100000007000001 errors Applied
20191100000007000002 errors Applied
20191100000007000003 errors Applied
20191100000008000000 selfservice_verification Applied
20191100000008000001 selfservice_verification Applied
20191100000008000002 selfservice_verification Applied
20191100000008000003 selfservice_verification Applied
20191100000008000004 selfservice_verification Applied
20191100000008000005 selfservice_verification Applied
20191100000010000000 errors Applied
20191100000010000001 errors Applied
20191100000010000002 errors Applied
20191100000010000003 errors Applied
20191100000010000004 errors Applied
20191100000011000000 courier_body_type Applied
20191100000011000001 courier_body_type Applied
20191100000011000002 courier_body_type Applied
20191100000011000003 courier_body_type Applied
20191100000012000000 login_request_forced Applied
20191100000012000001 login_request_forced Applied
20191100000012000002 login_request_forced Applied
20191100000012000003 login_request_forced Applied
20200317160354000000 create_profile_request_forms Applied
20200317160354000001 create_profile_request_forms Applied
20200317160354000002 create_profile_request_forms Applied
20200317160354000003 create_profile_request_forms Applied
20200317160354000004 create_profile_request_forms Applied
20200317160354000005 create_profile_request_forms Applied
20200317160354000006 create_profile_request_forms Applied
20200401183443000000 continuity_containers Applied
20200402142539000000 rename_profile_flows Applied
20200402142539000001 rename_profile_flows Applied
20200402142539000002 rename_profile_flows Applied
20200519101057000000 create_recovery_addresses Applied
20200519101057000001 create_recovery_addresses Applied
20200519101057000002 create_recovery_addresses Applied
20200519101057000003 create_recovery_addresses Applied
20200519101057000004 create_recovery_addresses Applied
20200519101057000005 create_recovery_addresses Applied
20200519101057000006 create_recovery_addresses Applied
20200519101057000007 create_recovery_addresses Applied
20200601101000000000 create_messages Applied
20200601101000000001 create_messages Applied
20200601101000000002 create_messages Applied
20200601101000000003 create_messages Applied
20200605111551000000 messages Applied
20200605111551000001 messages Applied
20200605111551000002 messages Applied
20200605111551000003 messages Applied
20200605111551000004 messages Applied
20200605111551000005 messages Applied
20200605111551000006 messages Applied
20200605111551000007 messages Applied
20200605111551000008 messages Applied
20200605111551000009 messages Applied
20200605111551000010 messages Applied
20200605111551000011 messages Applied
20200607165100000000 settings Applied
20200607165100000001 settings Applied
20200607165100000002 settings Applied
20200607165100000003 settings Applied
20200607165100000004 settings Applied
20200705105359000000 rename_identities_schema Applied
20200810141652000000 flow_type Applied
20200810141652000001 flow_type Applied
20200810141652000002 flow_type Applied
20200810141652000003 flow_type Applied
20200810141652000004 flow_type Applied
20200810141652000005 flow_type Applied
20200810141652000006 flow_type Applied
20200810141652000007 flow_type Applied
20200810141652000008 flow_type Applied
20200810141652000009 flow_type Applied
20200810141652000010 flow_type Applied
20200810141652000011 flow_type Applied
20200810141652000012 flow_type Applied
20200810141652000013 flow_type Applied
20200810141652000014 flow_type Applied
20200810141652000015 flow_type Applied
20200810141652000016 flow_type Applied
20200810141652000017 flow_type Applied
20200810141652000018 flow_type Applied
20200810141652000019 flow_type Applied
20200810161022000000 flow_rename Applied
20200810161022000001 flow_rename Applied
20200810161022000002 flow_rename Applied
20200810161022000003 flow_rename Applied
20200810161022000004 flow_rename Applied
20200810161022000005 flow_rename Applied
20200810161022000006 flow_rename Applied
20200810161022000007 flow_rename Applied
20200810161022000008 flow_rename Applied
20200810162450000000 flow_fields_rename Applied
20200810162450000001 flow_fields_rename Applied
20200810162450000002 flow_fields_rename Applied
20200810162450000003 flow_fields_rename Applied
20200812124254000000 add_session_token Applied
20200812124254000001 add_session_token Applied
20200812124254000002 add_session_token Applied
20200812124254000003 add_session_token Applied
20200812124254000004 add_session_token Applied
20200812124254000005 add_session_token Applied
20200812124254000006 add_session_token Applied
20200812124254000007 add_session_token Applied
20200812160551000000 add_session_revoke Applied
20200812160551000001 add_session_revoke Applied
20200812160551000002 add_session_revoke Applied
20200812160551000003 add_session_revoke Applied
20200812160551000004 add_session_revoke Applied
20200812160551000005 add_session_revoke Applied
20200812160551000006 add_session_revoke Applied
20200812160551000007 add_session_revoke Applied
20200830121710000000 update_recovery_token Applied
20200830130642000000 add_verification_methods Applied
20200830130642000001 add_verification_methods Applied
20200830130642000002 add_verification_methods Applied
20200830130642000003 add_verification_methods Applied
20200830130642000004 add_verification_methods Applied
20200830130642000005 add_verification_methods Applied
20200830130642000006 add_verification_methods Applied
20200830130642000007 add_verification_methods Applied
20200830130642000008 add_verification_methods Applied
20200830130642000009 add_verification_methods Applied
20200830130642000010 add_verification_methods Applied
20200830130643000000 add_verification_methods Applied
20200830130644000000 add_verification_methods Applied
20200830130644000001 add_verification_methods Applied
20200830130645000000 add_verification_methods Applied
20200830130646000000 add_verification_methods Applied
20200830130646000001 add_verification_methods Applied
20200830130646000002 add_verification_methods Applied
20200830130646000003 add_verification_methods Applied
20200830130646000004 add_verification_methods Applied
20200830130646000005 add_verification_methods Applied
20200830130646000006 add_verification_methods Applied
20200830130646000007 add_verification_methods Applied
20200830130646000008 add_verification_methods Applied
20200830130646000009 add_verification_methods Applied
20200830130646000010 add_verification_methods Applied
20200830130646000011 add_verification_methods Applied
20200830154602000000 add_verification_token Applied
20200830154602000001 add_verification_token Applied
20200830154602000002 add_verification_token Applied
20200830154602000003 add_verification_token Applied
20200830154602000004 add_verification_token Applied
20200830172221000000 recovery_token_expires Applied
20200830172221000001 recovery_token_expires Applied
20200830172221000002 recovery_token_expires Applied
20200830172221000003 recovery_token_expires Applied
20200830172221000004 recovery_token_expires Applied
20200830172221000005 recovery_token_expires Applied
20200830172221000006 recovery_token_expires Applied
20200830172221000007 recovery_token_expires Applied
20200830172221000008 recovery_token_expires Applied
20200830172221000009 recovery_token_expires Applied
20200830172221000010 recovery_token_expires Applied
20200830172221000011 recovery_token_expires Applied
20200830172221000012 recovery_token_expires Applied
20200830172221000013 recovery_token_expires Applied
20200830172221000014 recovery_token_expires Applied
20200830172221000015 recovery_token_expires Applied
20200830172221000016 recovery_token_expires Applied
20200830172221000017 recovery_token_expires Applied
20200830172221000018 recovery_token_expires Applied
20200830172221000019 recovery_token_expires Applied
20200830172221000020 recovery_token_expires Applied
20200830172221000021 recovery_token_expires Applied
20200830172221000022 recovery_token_expires Applied
20200830172221000023 recovery_token_expires Applied
20200830172221000024 recovery_token_expires Applied
20200831110752000000 identity_verifiable_address_remove_code Applied
20200831110752000001 identity_verifiable_address_remove_code Applied
20200831110752000002 identity_verifiable_address_remove_code Applied
20200831110752000003 identity_verifiable_address_remove_code Applied
20200831110752000004 identity_verifiable_address_remove_code Applied
20200831110752000005 identity_verifiable_address_remove_code Applied
20200831110752000006 identity_verifiable_address_remove_code Applied
20200831110752000007 identity_verifiable_address_remove_code Applied
20200831110752000008 identity_verifiable_address_remove_code Applied
20200831110752000009 identity_verifiable_address_remove_code Applied
20200831110752000010 identity_verifiable_address_remove_code Applied
20200831110752000011 identity_verifiable_address_remove_code Applied
20200831110752000012 identity_verifiable_address_remove_code Applied
20200831110752000013 identity_verifiable_address_remove_code Applied
20200831110752000014 identity_verifiable_address_remove_code Applied
20200831110752000015 identity_verifiable_address_remove_code Applied
20200831110752000016 identity_verifiable_address_remove_code Applied
20200831110752000017 identity_verifiable_address_remove_code Applied
20200831110752000018 identity_verifiable_address_remove_code Applied
20200831110752000019 identity_verifiable_address_remove_code Applied
20200831110752000020 identity_verifiable_address_remove_code Pending
20200831110752000021 identity_verifiable_address_remove_code Pending
20201201161451000000 credential_types_values Pending
20201201161451000001 credential_types_values Pending
stderr:

View File

@@ -0,0 +1,212 @@
stdout: Version Name Status
20191100000001000000 identities Applied
20191100000001000001 identities Applied
20191100000001000002 identities Applied
20191100000001000003 identities Applied
20191100000001000004 identities Applied
20191100000001000005 identities Applied
20191100000002000000 requests Applied
20191100000002000001 requests Applied
20191100000002000002 requests Applied
20191100000002000003 requests Applied
20191100000002000004 requests Applied
20191100000003000000 sessions Applied
20191100000004000000 errors Applied
20191100000006000000 courier Applied
20191100000007000000 errors Applied
20191100000007000001 errors Applied
20191100000007000002 errors Applied
20191100000007000003 errors Applied
20191100000008000000 selfservice_verification Applied
20191100000008000001 selfservice_verification Applied
20191100000008000002 selfservice_verification Applied
20191100000008000003 selfservice_verification Applied
20191100000008000004 selfservice_verification Applied
20191100000008000005 selfservice_verification Applied
20191100000010000000 errors Applied
20191100000010000001 errors Applied
20191100000010000002 errors Applied
20191100000010000003 errors Applied
20191100000010000004 errors Applied
20191100000011000000 courier_body_type Applied
20191100000011000001 courier_body_type Applied
20191100000011000002 courier_body_type Applied
20191100000011000003 courier_body_type Applied
20191100000012000000 login_request_forced Applied
20191100000012000001 login_request_forced Applied
20191100000012000002 login_request_forced Applied
20191100000012000003 login_request_forced Applied
20200317160354000000 create_profile_request_forms Applied
20200317160354000001 create_profile_request_forms Applied
20200317160354000002 create_profile_request_forms Applied
20200317160354000003 create_profile_request_forms Applied
20200317160354000004 create_profile_request_forms Applied
20200317160354000005 create_profile_request_forms Applied
20200317160354000006 create_profile_request_forms Applied
20200401183443000000 continuity_containers Applied
20200402142539000000 rename_profile_flows Applied
20200402142539000001 rename_profile_flows Applied
20200402142539000002 rename_profile_flows Applied
20200519101057000000 create_recovery_addresses Applied
20200519101057000001 create_recovery_addresses Applied
20200519101057000002 create_recovery_addresses Applied
20200519101057000003 create_recovery_addresses Applied
20200519101057000004 create_recovery_addresses Applied
20200519101057000005 create_recovery_addresses Applied
20200519101057000006 create_recovery_addresses Applied
20200519101057000007 create_recovery_addresses Applied
20200601101000000000 create_messages Applied
20200601101000000001 create_messages Applied
20200601101000000002 create_messages Applied
20200601101000000003 create_messages Applied
20200605111551000000 messages Applied
20200605111551000001 messages Applied
20200605111551000002 messages Applied
20200605111551000003 messages Applied
20200605111551000004 messages Applied
20200605111551000005 messages Applied
20200605111551000006 messages Applied
20200605111551000007 messages Applied
20200605111551000008 messages Applied
20200605111551000009 messages Applied
20200605111551000010 messages Applied
20200605111551000011 messages Applied
20200607165100000000 settings Applied
20200607165100000001 settings Applied
20200607165100000002 settings Applied
20200607165100000003 settings Applied
20200607165100000004 settings Applied
20200705105359000000 rename_identities_schema Applied
20200810141652000000 flow_type Applied
20200810141652000001 flow_type Applied
20200810141652000002 flow_type Applied
20200810141652000003 flow_type Applied
20200810141652000004 flow_type Applied
20200810141652000005 flow_type Applied
20200810141652000006 flow_type Applied
20200810141652000007 flow_type Applied
20200810141652000008 flow_type Applied
20200810141652000009 flow_type Applied
20200810141652000010 flow_type Applied
20200810141652000011 flow_type Applied
20200810141652000012 flow_type Applied
20200810141652000013 flow_type Applied
20200810141652000014 flow_type Applied
20200810141652000015 flow_type Applied
20200810141652000016 flow_type Applied
20200810141652000017 flow_type Applied
20200810141652000018 flow_type Applied
20200810141652000019 flow_type Applied
20200810161022000000 flow_rename Applied
20200810161022000001 flow_rename Applied
20200810161022000002 flow_rename Applied
20200810161022000003 flow_rename Applied
20200810161022000004 flow_rename Applied
20200810161022000005 flow_rename Applied
20200810161022000006 flow_rename Applied
20200810161022000007 flow_rename Applied
20200810161022000008 flow_rename Applied
20200810162450000000 flow_fields_rename Applied
20200810162450000001 flow_fields_rename Applied
20200810162450000002 flow_fields_rename Applied
20200810162450000003 flow_fields_rename Applied
20200812124254000000 add_session_token Applied
20200812124254000001 add_session_token Applied
20200812124254000002 add_session_token Applied
20200812124254000003 add_session_token Applied
20200812124254000004 add_session_token Applied
20200812124254000005 add_session_token Applied
20200812124254000006 add_session_token Applied
20200812124254000007 add_session_token Applied
20200812160551000000 add_session_revoke Applied
20200812160551000001 add_session_revoke Applied
20200812160551000002 add_session_revoke Applied
20200812160551000003 add_session_revoke Applied
20200812160551000004 add_session_revoke Applied
20200812160551000005 add_session_revoke Applied
20200812160551000006 add_session_revoke Applied
20200812160551000007 add_session_revoke Applied
20200830121710000000 update_recovery_token Applied
20200830130642000000 add_verification_methods Applied
20200830130642000001 add_verification_methods Applied
20200830130642000002 add_verification_methods Applied
20200830130642000003 add_verification_methods Applied
20200830130642000004 add_verification_methods Applied
20200830130642000005 add_verification_methods Applied
20200830130642000006 add_verification_methods Applied
20200830130642000007 add_verification_methods Applied
20200830130642000008 add_verification_methods Applied
20200830130642000009 add_verification_methods Applied
20200830130642000010 add_verification_methods Applied
20200830130643000000 add_verification_methods Applied
20200830130644000000 add_verification_methods Applied
20200830130644000001 add_verification_methods Applied
20200830130645000000 add_verification_methods Applied
20200830130646000000 add_verification_methods Applied
20200830130646000001 add_verification_methods Applied
20200830130646000002 add_verification_methods Applied
20200830130646000003 add_verification_methods Applied
20200830130646000004 add_verification_methods Applied
20200830130646000005 add_verification_methods Applied
20200830130646000006 add_verification_methods Applied
20200830130646000007 add_verification_methods Applied
20200830130646000008 add_verification_methods Applied
20200830130646000009 add_verification_methods Applied
20200830130646000010 add_verification_methods Applied
20200830130646000011 add_verification_methods Applied
20200830154602000000 add_verification_token Applied
20200830154602000001 add_verification_token Applied
20200830154602000002 add_verification_token Applied
20200830154602000003 add_verification_token Applied
20200830154602000004 add_verification_token Applied
20200830172221000000 recovery_token_expires Applied
20200830172221000001 recovery_token_expires Applied
20200830172221000002 recovery_token_expires Applied
20200830172221000003 recovery_token_expires Applied
20200830172221000004 recovery_token_expires Applied
20200830172221000005 recovery_token_expires Applied
20200830172221000006 recovery_token_expires Applied
20200830172221000007 recovery_token_expires Applied
20200830172221000008 recovery_token_expires Applied
20200830172221000009 recovery_token_expires Applied
20200830172221000010 recovery_token_expires Applied
20200830172221000011 recovery_token_expires Applied
20200830172221000012 recovery_token_expires Applied
20200830172221000013 recovery_token_expires Applied
20200830172221000014 recovery_token_expires Applied
20200830172221000015 recovery_token_expires Applied
20200830172221000016 recovery_token_expires Applied
20200830172221000017 recovery_token_expires Applied
20200830172221000018 recovery_token_expires Applied
20200830172221000019 recovery_token_expires Applied
20200830172221000020 recovery_token_expires Applied
20200830172221000021 recovery_token_expires Applied
20200830172221000022 recovery_token_expires Applied
20200830172221000023 recovery_token_expires Applied
20200830172221000024 recovery_token_expires Applied
20200831110752000000 identity_verifiable_address_remove_code Applied
20200831110752000001 identity_verifiable_address_remove_code Applied
20200831110752000002 identity_verifiable_address_remove_code Applied
20200831110752000003 identity_verifiable_address_remove_code Applied
20200831110752000004 identity_verifiable_address_remove_code Applied
20200831110752000005 identity_verifiable_address_remove_code Applied
20200831110752000006 identity_verifiable_address_remove_code Applied
20200831110752000007 identity_verifiable_address_remove_code Applied
20200831110752000008 identity_verifiable_address_remove_code Applied
20200831110752000009 identity_verifiable_address_remove_code Applied
20200831110752000010 identity_verifiable_address_remove_code Applied
20200831110752000011 identity_verifiable_address_remove_code Applied
20200831110752000012 identity_verifiable_address_remove_code Applied
20200831110752000013 identity_verifiable_address_remove_code Applied
20200831110752000014 identity_verifiable_address_remove_code Applied
20200831110752000015 identity_verifiable_address_remove_code Applied
20200831110752000016 identity_verifiable_address_remove_code Applied
20200831110752000017 identity_verifiable_address_remove_code Applied
20200831110752000018 identity_verifiable_address_remove_code Pending
20200831110752000019 identity_verifiable_address_remove_code Pending
20200831110752000020 identity_verifiable_address_remove_code Pending
20200831110752000021 identity_verifiable_address_remove_code Pending
20201201161451000000 credential_types_values Pending
20201201161451000001 credential_types_values Pending
stderr:

270
oryx/popx/cmd.go Normal file
View File

@@ -0,0 +1,270 @@
// Copyright © 2024 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package popx
import (
"context"
"fmt"
"time"
"github.com/spf13/cobra"
"github.com/ory/x/cmdx"
"github.com/ory/x/errorsx"
"github.com/ory/x/flagx"
)
type MigrationProvider interface {
MigrationStatus(context.Context) (MigrationStatuses, error)
MigrateUp(context.Context) error
MigrateDown(context.Context, int) error
}
type MigrationPreparer interface {
PrepareMigration(context.Context) error
}
func RegisterMigrateSQLUpFlags(cmd *cobra.Command) *cobra.Command {
cmd.Flags().BoolP("yes", "y", false, "If set all confirmation requests are accepted without user interaction.")
return cmd
}
func NewMigrateSQLUpCmd(runE func(cmd *cobra.Command, args []string) error) *cobra.Command {
return RegisterMigrateSQLUpFlags(&cobra.Command{
Use: "up [database_url]",
Args: cobra.RangeArgs(0, 1),
Short: "Apply all pending SQL migrations",
Long: `This command applies all pending SQL migrations for Ory {{ title .Root.Name }}.
:::warning
Before running this command, create a backup of your database. This command can be destructive as it may apply changes that cannot be easily reverted. Run this command close to the SQL instance (same VPC / same machine).
:::
It is recommended to review the migrations before running them. You can do this by running the command without the --yes flag:
DSN=... {{ .CommandPath }} -e`,
Example: `Apply all pending migrations:
DSN=... {{ .CommandPath }} -e
Apply all pending migrations:
DSN=... {{ .CommandPath }} -e --yes`,
RunE: runE,
})
}
func MigrateSQLUp(cmd *cobra.Command, p MigrationProvider) (err error) {
// convert migration tables
if prep, ok := p.(MigrationPreparer); ok {
if err := prep.PrepareMigration(cmd.Context()); err != nil {
_, _ = fmt.Fprintf(cmd.ErrOrStderr(), "Could not convert the migration table:\n%+v\n", err)
return cmdx.FailSilently(cmd)
}
}
// print migration status
_, _ = fmt.Fprintln(cmd.OutOrStdout(), "The migration plan is as follows:")
// print migration status
status, err := p.MigrationStatus(cmd.Context())
if err != nil {
_, _ = fmt.Fprintf(cmd.ErrOrStderr(), "Could not get the migration status:\n%+v\n", errorsx.WithStack(err))
return cmdx.FailSilently(cmd)
}
cmdx.PrintTable(cmd, status)
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "\nThe SQL statements to be executed from top to bottom are:\n\n")
for i := range status {
if status[i].State == Pending {
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "------------ %s - %s ------------\n", status[i].Version, status[i].Name)
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "%s\n\n", status[i].ContentUp)
}
}
if !flagx.MustGetBool(cmd, "yes") {
_, _ = fmt.Fprintln(cmd.ErrOrStderr(), "To skip the next question use flag --yes (at your own risk).")
if !cmdx.AskForConfirmation("Do you wish to execute this migration plan?", cmd.InOrStdin(), cmd.OutOrStdout()) {
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "------------ WARNING ------------\n")
_, _ = fmt.Fprintln(cmd.OutOrStdout(), "Migration aborted.")
return nil
}
}
// apply migrations
if err := p.MigrateUp(cmd.Context()); err != nil {
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "------------ ERROR ------------\n")
_, _ = fmt.Fprintf(cmd.ErrOrStderr(), "Could not apply migrations:\n%+v\n", errorsx.WithStack(err))
return cmdx.FailSilently(cmd)
}
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "------------ SUCCESS ------------\n")
_, _ = fmt.Fprintln(cmd.OutOrStdout(), "Successfully applied migrations!")
return nil
}
func RegisterMigrateSQLDownFlags(cmd *cobra.Command) *cobra.Command {
cmd.Flags().BoolP("yes", "y", false, "If set all confirmation requests are accepted without user interaction.")
cmd.Flags().Int("steps", 0, "The number of migrations to roll back.")
return cmd
}
func NewMigrateSQLDownCmd(runE func(cmd *cobra.Command, args []string) error) *cobra.Command {
return RegisterMigrateSQLDownFlags(&cobra.Command{
Use: "down [database_url]",
Args: cobra.RangeArgs(0, 1),
Short: "Rollback the last applied SQL migrations",
Long: `This command rolls back the last applied SQL migrations for Ory {{ title .Root.Name }}.
:::warning
Before running this command, create a backup of your database. This command can be destructive as it may revert changes made by previous migrations. Run this command close to the SQL instance (same VPC / same machine).
:::
It is recommended to review the migrations before running them. You can do this by running the command without the --yes flag:
DSN=... {{ .CommandPath }} -e`,
Example: `See the current migration status:
DSN=... {{ .CommandPath }} -e
Rollback the last 10 migrations:
{{ .CommandPath }} $DSN --steps 10
Rollback the last 10 migrations without confirmation:
DSN=... {{ .CommandPath }} -e --yes --steps 10`,
RunE: runE,
})
}
func MigrateSQLDown(cmd *cobra.Command, p MigrationProvider) (err error) {
steps := flagx.MustGetInt(cmd, "steps")
if steps < 0 {
_, _ = fmt.Fprintln(cmd.ErrOrStderr(), "Flag --steps must be larger than 0.")
return cmdx.FailSilently(cmd)
}
// convert migration tables
if prep, ok := p.(MigrationPreparer); ok {
if err := prep.PrepareMigration(cmd.Context()); err != nil {
_, _ = fmt.Fprintf(cmd.ErrOrStderr(), "Could not convert the migration table:\n%+v\n", err)
return cmdx.FailSilently(cmd)
}
}
status, err := p.MigrationStatus(cmd.Context())
if err != nil {
_, _ = fmt.Fprintf(cmd.ErrOrStderr(), "Could not get the migration status:\n%+v\n", errorsx.WithStack(err))
return cmdx.FailSilently(cmd)
}
// Now we need to rollback the last `steps` migrations that have a status of "Applied":
var count int
var rollingBack int
for i := len(status) - 1; i >= 0; i-- {
if status[i].State == Applied {
count++
if steps > 0 && count <= steps {
status[i].State = "Rollback"
rollingBack++
}
}
}
// print migration status
_, _ = fmt.Fprintln(cmd.OutOrStdout(), "The migration plan is as follows:")
cmdx.PrintTable(cmd, status)
if rollingBack < 1 {
_, _ = fmt.Fprintln(cmd.ErrOrStderr(), "")
_, _ = fmt.Fprintln(cmd.ErrOrStderr(), "There are apparently no migrations to roll back.")
_, _ = fmt.Fprintln(cmd.ErrOrStderr(), "Please provide the --steps argument with a value larger than 0.")
_, _ = fmt.Fprintln(cmd.ErrOrStderr(), "")
return cmdx.FailSilently(cmd)
}
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "\nThe SQL statements to be executed from top to bottom are:\n\n")
for i := len(status) - 1; i >= 0; i-- {
if status[i].State == "Rollback" {
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "------------ %s - %s ------------\n", status[i].Version, status[i].Name)
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "%s\n\n", status[i].ContentDown)
}
}
if !flagx.MustGetBool(cmd, "yes") {
_, _ = fmt.Fprintln(cmd.ErrOrStderr(), "To skip the next question use flag --yes (at your own risk).")
if !cmdx.AskForConfirmation("Do you wish to execute this migration plan?", cmd.InOrStdin(), cmd.OutOrStdout()) {
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "------------ WARNING ------------\n")
_, _ = fmt.Fprintln(cmd.OutOrStdout(), "Migration aborted.")
return nil
}
}
// apply migrations
if err := p.MigrateDown(cmd.Context(), rollingBack); err != nil {
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "------------ ERROR ------------\n")
_, _ = fmt.Fprintf(cmd.ErrOrStderr(), "Could not apply migrations:\n%+v\n", errorsx.WithStack(err))
return cmdx.FailSilently(cmd)
}
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "------------ SUCCESS ------------\n")
_, _ = fmt.Fprintln(cmd.OutOrStdout(), "Successfully applied migrations!")
return nil
}
func RegisterMigrateStatusFlags(cmd *cobra.Command) *cobra.Command {
cmdx.RegisterFormatFlags(cmd.PersistentFlags())
cmd.Flags().BoolP("read-from-env", "e", false, "If set, reads the database connection string from the environment variable DSN or config file key dsn.")
cmd.Flags().Bool("block", false, "Block until all migrations have been applied")
return cmd
}
func NewMigrateSQLStatusCmd(runE func(cmd *cobra.Command, args []string) error) *cobra.Command {
return RegisterMigrateStatusFlags(&cobra.Command{
Use: "status [database_url]",
Short: "Display the current migration status",
Long: `This command shows the current migration status for Ory {{ title .Root.Name }}.
You can use this command to check which migrations have been applied and which are pending.
To block until all migrations are applied, use the --block flag:
DSN=... {{ .CommandPath }} -e --block`,
Example: `See the current migration status:
DSN=... {{ .CommandPath }} -e
Block until all migrations are applied:
DSN=... {{ .CommandPath }} -e --block`,
RunE: runE,
})
}
func MigrateStatus(cmd *cobra.Command, p MigrationProvider) (err error) {
block := flagx.MustGetBool(cmd, "block")
ctx := cmd.Context()
s, err := p.MigrationStatus(ctx)
if err != nil {
_, _ = fmt.Fprintf(cmd.ErrOrStderr(), "Could not get migration status: %+v\n", err)
return cmdx.FailSilently(cmd)
}
for block && s.HasPending() {
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "Waiting for migrations to finish...\n")
for _, m := range s {
if m.State == Pending {
_, _ = fmt.Fprintf(cmd.OutOrStdout(), " - %s\n", m.Name)
}
}
time.Sleep(time.Second)
s, err = p.MigrationStatus(ctx)
if err != nil {
_, _ = fmt.Fprintf(cmd.ErrOrStderr(), "Could not get migration status: %+v\n", err)
return cmdx.FailSilently(cmd)
}
}
cmdx.PrintTable(cmd, s)
return nil
}

60
oryx/popx/db_columns.go Normal file
View File

@@ -0,0 +1,60 @@
// Copyright © 2025 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package popx
import (
"fmt"
"strings"
"github.com/ory/pop/v6"
)
func DBColumns[T any](quoter Quoter) string {
return (&pop.Model{Value: new(T)}).Columns().QuotedString(quoter)
}
// IndexHint returns the table name including the index hint, if the database
// supports it.
func IndexHint(conn *pop.Connection, table string, index string) string {
if conn.Dialect.Name() == "cockroach" {
return table + "@" + index
}
// PostgreSQL and YugabyteDB do not accept CockroachDB's @index syntax.
return table
}
func DBColumnsExcluding[T any](quoter Quoter, exclude ...string) string {
cols := (&pop.Model{Value: new(T)}).Columns()
for _, e := range exclude {
cols.Remove(e)
}
return cols.QuotedString(quoter)
}
type (
AliasQuoter struct {
Alias string
Quoter Quoter
}
Quoter interface {
Quote(key string) string
}
)
func (pq *AliasQuoter) Quote(key string) string {
return fmt.Sprintf("%s.%s", pq.Quoter.Quote(pq.Alias), pq.Quoter.Quote(key))
}
// Placeholders returns `num` placeholders ?, e.g. "?, ?, ?".
// Placeholders(0) returns "".
func Placeholders(num int) string {
switch num {
case 0:
return ""
case 1:
return "?"
default:
return strings.Repeat("?, ", num-1) + "?"
}
}

View File

@@ -0,0 +1,78 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package popx
import (
"context"
"strings"
"github.com/pkg/errors"
"github.com/ory/pop/v6"
"github.com/ory/x/dbal"
)
// VerifyDialect makes sure the declared SQL dialect matches the actual
// database server. It distinguishes PostgreSQL, CockroachDB, and YugabyteDB:
// all three speak the Postgres wire protocol, so an operator can easily point
// a service configured for one at a server running another. That mismatch
// silently selects the wrong dialect-specific migrations and produces broken
// schemas.
//
// Other dialects (MySQL, SQLite) are skipped.
func VerifyDialect(ctx context.Context, conn *pop.Connection) error {
declared := conn.Dialect.Name()
if declared != namePostgres && declared != dbal.DriverCockroachDB && declared != dbal.DriverYugabyteDB {
return nil
}
var version string
if err := conn.WithContext(ctx).RawQuery("SELECT version() AS version").First(&version); err != nil {
return errors.Wrap(err, "could not query database version to verify dialect")
}
return checkDialect(declared, version, pop.DialectSupported(dbal.DriverYugabyteDB))
}
const (
namePostgres = "postgres"
// yugabyteVersionMarker identifies a YugabyteDB server in the output of
// SELECT version() (e.g. "PostgreSQL 11.2-YB-2025.2.4.0-b122 ...").
yugabyteVersionMarker = "-YB-"
)
func checkDialect(declared, version string, yugabyteDialectSupported bool) error {
detectedCockroach := strings.Contains(version, "CockroachDB")
detectedYugabyte := strings.Contains(version, yugabyteVersionMarker)
switch {
case declared == dbal.DriverCockroachDB && !detectedCockroach:
return errors.Errorf(
"DSN scheme cockroach:// declares a CockroachDB database but the server is not CockroachDB. Server reported: %q. Use a postgres:// DSN, or point the service at a CockroachDB cluster.",
firstLine(version),
)
case declared == dbal.DriverYugabyteDB && !detectedYugabyte:
return errors.Errorf(
"DSN scheme yugabyte:// declares a YugabyteDB database but the server is not YugabyteDB. Server reported: %q. Use a DSN scheme matching the actual server, or point the service at a YugabyteDB cluster.",
firstLine(version),
)
case declared == namePostgres && detectedCockroach:
return errors.Errorf(
"DSN scheme postgres:// declares a PostgreSQL database but the server is CockroachDB. Replace the scheme with cockroach:// so that the service picks the correct migrations and SQL dialect. Server reported: %q",
firstLine(version),
)
case declared == namePostgres && detectedYugabyte && yugabyteDialectSupported:
return errors.Errorf(
"DSN scheme postgres:// declares a PostgreSQL database but the server is YugabyteDB. Replace the scheme with yugabyte:// (supported in Ory Enterprise License builds) so that the service picks the correct migrations. Server reported: %q",
firstLine(version),
)
}
return nil
}
func firstLine(s string) string {
if i := strings.IndexByte(s, '\n'); i >= 0 {
return s[:i]
}
return s
}

53
oryx/popx/loggers.go Normal file
View File

@@ -0,0 +1,53 @@
// Copyright © 2024 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package popx
import (
"fmt"
"testing"
"github.com/ory/pop/v6"
"github.com/ory/pop/v6/logging"
)
func formatter(lvl logging.Level, s string, args ...interface{}) string {
if pop.Debug == false {
return ""
}
if lvl == logging.SQL {
if len(args) > 0 {
xargs := make([]string, len(args))
for i, a := range args {
switch a.(type) {
case string:
xargs[i] = fmt.Sprintf("%q", a)
default:
xargs[i] = fmt.Sprintf("%v", a)
}
}
s = fmt.Sprintf("%s - %s | %s", lvl, s, xargs)
} else {
s = fmt.Sprintf("%s - %s", lvl, s)
}
} else {
s = fmt.Sprintf(s, args...)
s = fmt.Sprintf("%s - %s", lvl, s)
}
return s
}
func TestingLogger(t testing.TB) func(lvl logging.Level, s string, args ...interface{}) {
return func(lvl logging.Level, s string, args ...interface{}) {
if line := formatter(lvl, s, args...); len(line) > 0 {
t.Log(line)
}
}
}
func NullLogger() func(lvl logging.Level, s string, args ...interface{}) {
return func(lvl logging.Level, s string, args ...interface{}) {
// do nothing
}
}

97
oryx/popx/match.go Normal file
View File

@@ -0,0 +1,97 @@
// Copyright © 2024 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package popx
import (
"regexp"
"strings"
"github.com/pkg/errors"
"github.com/ory/pop/v6"
"github.com/ory/x/dbal"
)
var errUnsupportedMigrationDialect = errors.New("unsupported dialect")
var MigrationFileRegexp = regexp.MustCompile(
`^(\d+)_([^.]+)(\.[a-z0-9]+)?(\.autocommit)?\.(up|down)\.(sql)$`,
)
const (
// Human-readable constants for the regex capture groups
versionIdx = iota + 1
nameIdx
dbTypeIdx
autocommitIdx
directionIdx
typeIdx
)
// match holds the information parsed from a migration filename.
type match struct {
Version string
Name string
DBType string
Direction string
Type string
Autocommit bool
}
// parseMigrationFilename parses a migration filename.
func parseMigrationFilename(filename string) (*match, error) {
matches := MigrationFileRegexp.FindAllStringSubmatch(filename, -1)
if len(matches) == 0 {
return nil, nil
}
m := matches[0]
var (
autocommit bool
dbType string
)
if m[dbTypeIdx] == ".autocommit" {
// A special case where autocommit group moves forward to the 3rd index.
autocommit = true
dbType = "all"
} else if m[dbTypeIdx] == "" {
dbType = "all"
} else {
dbType = strings.TrimPrefix(m[dbTypeIdx], ".")
// The commercial package registers this dialect from init(), but
// migration boxes can be constructed before that package enters the
// import graph. Canonicalize both accepted spellings independently of
// registration so migration selection is deterministic in every build.
switch dbType {
case dbal.DriverYugabyteDB, "yugabytedb":
dbType = dbal.DriverYugabyteDB
default:
dbType = pop.CanonicalDialect(dbType)
}
if dbType != dbal.DriverYugabyteDB && !pop.DialectSupported(dbType) {
return nil, errors.Wrapf(errUnsupportedMigrationDialect, "%s", dbType)
}
}
if m[typeIdx] == "fizz" && dbType != "all" {
return nil, errors.Errorf("invalid database type %q, expected \"all\" because fizz is database type independent", dbType)
}
if m[autocommitIdx] == ".autocommit" {
autocommit = true
} else if m[autocommitIdx] != "" {
return nil, errors.Errorf("invalid autocommit flag %q", m[autocommitIdx])
}
return &match{
Version: m[versionIdx],
Name: m[nameIdx],
DBType: dbType,
Autocommit: autocommit,
Direction: m[directionIdx],
Type: m[typeIdx],
}, nil
}

371
oryx/popx/migration_box.go Normal file
View File

@@ -0,0 +1,371 @@
// Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package popx
import (
"database/sql"
"fmt"
"io/fs"
"path"
"regexp"
"slices"
"sort"
"strings"
"testing"
"time"
"github.com/pkg/errors"
"github.com/stretchr/testify/require"
"github.com/ory/pop/v6"
"github.com/ory/x/dbal"
"github.com/ory/x/logrusx"
)
type (
// MigrationBox is a embed migration box.
MigrationBox struct {
c *pop.Connection
migrationsUp Migrations
migrationsDown Migrations
perMigrationTimeout time.Duration
l *logrusx.Logger
migrationContent MigrationContent
disableGoldenDatabase bool
sqliteTemplateCacheDir string
}
MigrationContent func(mf Migration, c *pop.Connection, r []byte, usingTemplate bool) (string, error)
MigrationBoxOption func(*MigrationBox)
)
func WithTemplateValues(v map[string]interface{}) MigrationBoxOption {
return func(m *MigrationBox) {
m.migrationContent = ParameterizedMigrationContent(v)
}
}
func WithMigrationContentMiddleware(middleware func(content string, err error) (string, error)) MigrationBoxOption {
return func(m *MigrationBox) {
prev := m.migrationContent
m.migrationContent = func(mf Migration, c *pop.Connection, r []byte, usingTemplate bool) (string, error) {
return middleware(prev(mf, c, r, usingTemplate))
}
}
}
// WithGoMigrations adds migrations that have a custom migration runner.
// TEST THEM THOROUGHLY!
// It will be very hard to fix a buggy migration.
func WithGoMigrations(migrations Migrations) MigrationBoxOption {
return func(mb *MigrationBox) {
for _, m := range migrations {
switch m.Direction {
case "up":
mb.migrationsUp = append(mb.migrationsUp, m)
case "down":
mb.migrationsDown = append(mb.migrationsDown, m)
default:
panic(fmt.Sprintf("unknown migration direction %q for %q", m.Direction, m.Version))
}
}
}
}
func WithPerMigrationTimeout(timeout time.Duration) MigrationBoxOption {
return func(m *MigrationBox) {
m.perMigrationTimeout = timeout
}
}
// WithoutGoldenDatabase disables the golden database optimisation for SQLite
// test databases. Use this when the caller asserts on migration execution
// side-effects (e.g. exact timing, call counts, or intermediate schema state).
func WithoutGoldenDatabase() MigrationBoxOption {
return func(m *MigrationBox) {
m.disableGoldenDatabase = true
}
}
// WithSQLiteTemplateCacheDir stores pre-migrated SQLite test database
// templates in dir. By default, templates are stored in os.TempDir.
//
// This option only affects on-disk SQLite databases while running tests.
func WithSQLiteTemplateCacheDir(dir string) MigrationBoxOption {
return func(m *MigrationBox) {
m.sqliteTemplateCacheDir = dir
}
}
var testdataPattern = regexp.MustCompile(`^(\d+)_testdata(|\.[a-zA-Z0-9]+).sql$`)
// WithTestdata adds testdata to the migration box.
func WithTestdata(t *testing.T, testdata fs.FS) MigrationBoxOption {
return func(m *MigrationBox) {
// Testdata may not change the golden-database hash,
// so it should not share or create a golden database.
m.disableGoldenDatabase = true
require.NoError(t, fs.WalkDir(testdata, ".", func(path string, info fs.DirEntry, err error) error {
if err != nil {
return errors.WithStack(err)
}
if info.Name() == "." {
return nil
}
if !info.Type().IsRegular() {
t.Logf("skipping testdata entry that is not a file: %s", path)
return nil
}
match := testdataPattern.FindStringSubmatch(info.Name())
if len(match) != 2 && len(match) != 3 {
t.Logf(`WARNING! Found a test migration which does not match the test data pattern: %s`, info.Name())
return nil
}
version := match[1]
flavor := "all"
if len(match) == 3 && len(match[2]) > 0 {
flavor = pop.CanonicalDialect(strings.TrimPrefix(match[2], "."))
}
// t.Logf("Found test migration \"%s\" (%s, %+v): %s", flavor, match, err, info.Name())
m.migrationsUp = append(m.migrationsUp, Migration{
Version: version + "9", // run testdata after version
Path: path,
Name: info.Name(),
DBType: flavor,
Direction: "up",
Type: "sql",
Runner: func(m Migration, c *pop.Connection) error {
b, err := fs.ReadFile(testdata, m.Path)
if err != nil {
return errors.WithStack(err)
}
if isMigrationEmpty(string(b)) {
return nil
}
_, err = c.Store.SQLDB().Exec(string(b))
return errors.WithStack(err)
},
})
m.migrationsDown = append(m.migrationsDown, Migration{
Version: version + "9", // run testdata after version
Path: path,
Name: info.Name(),
DBType: flavor,
Direction: "down",
Type: "sql",
Runner: func(m Migration, _ *pop.Connection) error { return nil },
})
return nil
}))
}
}
var emptySQLReplace = regexp.MustCompile(`(?m)^(\s*--.*|\s*)$`)
func isMigrationEmpty(content string) bool {
return len(strings.ReplaceAll(emptySQLReplace.ReplaceAllString(content, ""), "\n", "")) == 0
}
type queryExecutor interface {
Exec(query string, args ...any) (sql.Result, error)
}
// NewMigrationBox creates a new migration box.
func NewMigrationBox(dir fs.FS, c *pop.Connection, l *logrusx.Logger, opts ...MigrationBoxOption) (*MigrationBox, error) {
mb := &MigrationBox{
c: c,
l: l,
migrationContent: ParameterizedMigrationContent(nil),
}
for _, o := range opts {
o(mb)
}
txRunner := func(b []byte) func(Migration, *pop.Connection) error {
return func(mf Migration, c *pop.Connection) error {
content, err := mb.migrationContent(mf, c, b, true)
if err != nil {
return errors.Wrapf(err, "error processing %s", mf.Path)
}
if isMigrationEmpty(content) {
l.WithField("migration", mf.Path).Trace("This is usually ok - ignoring migration because content is empty. This is ok!")
return nil
}
var q queryExecutor = c.Store.SQLDB()
if c.TX != nil {
q = c.TX
}
if _, err = q.Exec(content); err != nil {
return errors.Wrapf(err, "error executing %s, sql: %s", mf.Path, content)
}
return nil
}
}
err := mb.findMigrations(dir, txRunner)
if err != nil {
return mb, err
}
if err := mb.check(); err != nil {
return nil, err
}
return mb, nil
}
// migrationFallbacks returns the ordered dialects migration selection falls
// back to before the generic ("all") file (.yugabyte. → .postgres. → generic
// for YugabyteDB, no fallbacks otherwise).
func (mb *MigrationBox) migrationFallbacks() []string {
if mb.c.Dialect.Name() == dbal.DriverYugabyteDB {
return []string{dbal.DriverPostgreSQL}
}
return nil
}
// SelectedMigrations returns a copy of the migrations selected for the
// connection's dialect and direction. It uses the same exact-match and fallback
// ranking as Up, Down, and Status so callers can audit the effective migration
// set without duplicating filename-selection logic.
func (mb *MigrationBox) SelectedMigrations(direction string) (Migrations, error) {
dialect := mb.c.Dialect.Name()
fallbacks := mb.migrationFallbacks()
switch direction {
case "up":
return slices.Clone(mb.migrationsUp.sortAndFilter(dialect, fallbacks...)), nil
case "down":
return slices.Clone(mb.migrationsDown.sortAndFilter(dialect, fallbacks...)), nil
default:
return nil, errors.Errorf("unknown migration direction %q", direction)
}
}
// noTxDDL reports whether the dialect cannot run DDL inside a transaction, so
// both migrations and the migration-status table setup must run in autocommit
// mode. CockroachDB and MySQL auto-commit each DDL statement; YugabyteDB
// restricts DDL inside transactions. Because there is no surrounding
// transaction to roll back a partial failure, new YugabyteDB migrations must
// contain one idempotent statement per file. YugabyteDB also inherits older
// PostgreSQL migration files that predate this rule; service-level guard tests
// track that replay risk, and a dedicated .yugabyte. override is required when
// a new unsafe inherited migration appears.
func (mb *MigrationBox) noTxDDL() bool {
switch mb.c.Dialect.Name() {
case dbal.DriverCockroachDB, dbal.DriverMySQL, dbal.DriverYugabyteDB:
return true
}
return false
}
func (mb *MigrationBox) findMigrations(
dir fs.FS,
runner func([]byte) func(m Migration, c *pop.Connection) error,
) error {
err := fs.WalkDir(dir, ".", func(p string, info fs.DirEntry, err error) error {
if err != nil {
return errors.WithStack(err)
}
if !info.Type().IsRegular() {
mb.l.Tracef("ignoring non file: %s", info.Name())
return nil
}
if path.Ext(info.Name()) != ".sql" {
mb.l.Tracef("ignoring non SQL file: %s", info.Name())
return nil
}
details, err := parseMigrationFilename(info.Name())
if err != nil {
if errors.Is(err, errUnsupportedMigrationDialect) {
mb.l.Debugf("Ignoring migration file %s because its dialect is not supported: %s", info.Name(), err.Error())
return nil
}
return errors.WithStack(err)
}
if details == nil {
return errors.Errorf("Found a migration file that does not match the file pattern: filename=%s pattern=%s", info.Name(), MigrationFileRegexp)
}
content, err := fs.ReadFile(dir, p)
if err != nil {
return errors.WithStack(err)
}
mf := Migration{
Path: p,
Version: details.Version,
Name: details.Name,
DBType: details.DBType,
Direction: details.Direction,
Type: details.Type,
Content: string(content),
Autocommit: details.Autocommit,
}
mf.Runner = runner(content)
switch details.Direction {
case "up":
mb.migrationsUp = append(mb.migrationsUp, mf)
case "down":
mb.migrationsDown = append(mb.migrationsDown, mf)
default:
return errors.Errorf("unknown migration direction %q for %q", details.Direction, info.Name())
}
return nil
})
// Sort descending.
sort.Sort(mb.migrationsDown)
slices.Reverse(mb.migrationsDown)
// Sort ascending.
sort.Sort(mb.migrationsUp)
return errors.WithStack(err)
}
// hasDownMigrationWithVersion checks if there is a migration with the given
// version.
func (mb *MigrationBox) hasDownMigrationWithVersion(version string) bool {
for _, down := range mb.migrationsDown {
if version == down.Version {
return true
}
}
return false
}
// check checks that every "up" migration has a corresponding "down" migration.
func (mb *MigrationBox) check() error {
for _, up := range mb.migrationsUp {
if !mb.hasDownMigrationWithVersion(up.Version) {
return errors.Errorf("migration %s has no corresponding down migration", up.Version)
}
}
for _, n := range mb.migrationsUp {
if err := n.Valid(); err != nil {
return errors.WithStack(err)
}
}
for _, n := range mb.migrationsDown {
if err := n.Valid(); err != nil {
return errors.WithStack(err)
}
}
return nil
}

View File

@@ -0,0 +1,54 @@
// Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package popx
import (
"bytes"
"text/template"
"github.com/pkg/errors"
"github.com/ory/pop/v6"
"github.com/ory/x/dbal"
)
func ParameterizedMigrationContent(params map[string]interface{}) func(mf Migration, c *pop.Connection, r []byte, usingTemplate bool) (string, error) {
return func(mf Migration, c *pop.Connection, b []byte, usingTemplate bool) (string, error) {
content := ""
if usingTemplate {
t := template.New("migration")
t.Funcs(SQLTemplateFuncs)
t, err := t.Parse(string(b))
if err != nil {
return "", errors.Wrapf(err, "could not parse template %s", mf.Path)
}
var bb bytes.Buffer
err = t.Execute(&bb, struct {
IsSQLite bool
IsCockroach bool
IsMySQL bool
IsMariaDB bool
IsPostgreSQL bool
DialectDetails *pop.ConnectionDetails
Parameters map[string]interface{}
}{
IsSQLite: c.Dialect.Name() == "sqlite3",
IsCockroach: c.Dialect.Name() == "cockroach",
IsMySQL: c.Dialect.Name() == "mysql",
IsMariaDB: c.Dialect.Name() == "mariadb",
IsPostgreSQL: dbal.IsPostgresCompatible(c.Dialect.Name()),
DialectDetails: c.Dialect.Details(),
Parameters: params,
})
if err != nil {
return "", errors.Wrapf(err, "could not execute migration template %s", mf.Path)
}
content = bb.String()
} else {
content = string(b)
}
return content, nil
}
}

130
oryx/popx/migration_info.go Normal file
View File

@@ -0,0 +1,130 @@
// Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package popx
import (
"sort"
"strings"
"github.com/pkg/errors"
"github.com/ory/pop/v6"
)
// Migration handles the data for a given database migration
type Migration struct {
// Path to the migration (./migrations/123_create_widgets.up.sql)
Path string
// Version of the migration (123)
Version string
// Name of the migration (create_widgets)
Name string
// Direction of the migration (up|down)
Direction string
// Type of migration (sql|go)
Type string
// DB type (all|postgres|mysql...)
DBType string
// Runner function to run/execute the migration. Will be wrapped in a
// database transaction. Mutually exclusive with RunnerNoTx
Runner func(Migration, *pop.Connection) error
// Content is the raw content of the migration file
Content string
// Autocommit indicates whether the migration should be run in autocommit mode
Autocommit bool
}
func (m Migration) Valid() error {
if m.Runner == nil {
return errors.Errorf("no runner defined for %s", m.Path)
}
return nil
}
// Migrations is a collection of Migration
type Migrations []Migration
func (mfs Migrations) Len() int { return len(mfs) }
func (mfs Migrations) Less(i, j int) bool { return compareMigration(mfs[i], mfs[j]) < 0 }
func (mfs Migrations) Swap(i, j int) { mfs[i], mfs[j] = mfs[j], mfs[i] }
func compareMigration(a, b Migration) int {
if a.Version != b.Version {
return strings.Compare(a.Version, b.Version)
}
// Force "all" to be greater.
if a.DBType == "all" && b.DBType != "all" {
return 1
} else if a.DBType != "all" && b.DBType == "all" {
return -1
}
return strings.Compare(a.DBType, b.DBType)
}
// migrationRank ranks a migration's DBType for the given dialect and its ordered
// fallbacks. Higher numbers indicate a better match:
//
// -1 not applicable
// 0 "all" (generic, dialect-independent)
// 1..n a fallback dialect (earlier fallbacks rank higher)
// n+1 the exact dialect
//
// This lets a migration box prefer a dialect-specific override, then a fallback
// dialect (e.g. postgres for a postgres-wire-compatible database), then the
// generic file.
func migrationRank(dbType, dialect string, fallbacks []string) int {
switch dbType {
case dialect:
return len(fallbacks) + 1
case "all":
return 0
}
for i, fb := range fallbacks {
if dbType == fb {
return len(fallbacks) - i
}
}
return -1
}
func (mfs Migrations) sortAndFilter(dialect string, fallbacks ...string) Migrations {
byVersion := make(map[string]Migration, len(mfs))
for _, migration := range mfs {
rank := migrationRank(migration.DBType, dialect, fallbacks)
if rank < 0 {
// Not applicable to this dialect.
continue
}
if previousMigration, ok := byVersion[migration.Version]; ok {
if rank < migrationRank(previousMigration.DBType, dialect, fallbacks) {
// Previous migration is a better match, skip this one.
continue
}
}
byVersion[migration.Version] = migration
}
filtered := make(Migrations, 0, len(byVersion))
for k := range byVersion {
filtered = append(filtered, byVersion[k])
}
sort.Sort(filtered)
return filtered
}
func (mfs Migrations) find(version, dialect string, fallbacks ...string) *Migration {
var candidate *Migration
bestRank := -1
for i := range mfs {
if mfs[i].Version != version {
continue
}
if rank := migrationRank(mfs[i].DBType, dialect, fallbacks); rank > bestRank {
bestRank = rank
candidate = &mfs[i]
}
}
return candidate
}

724
oryx/popx/migrator.go Normal file
View File

@@ -0,0 +1,724 @@
// Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package popx
import (
"context"
"crypto/sha256"
"database/sql"
"database/sql/driver"
"encoding/hex"
"fmt"
"math"
"os"
"path/filepath"
"regexp"
"slices"
"strings"
"testing"
"time"
"github.com/cockroachdb/cockroach-go/v2/crdb"
"github.com/gofrs/flock"
"github.com/pkg/errors"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/trace"
moderncsqlite "modernc.org/sqlite"
"github.com/ory/pop/v6"
"github.com/ory/x/cmdx"
"github.com/ory/x/dbal"
"github.com/ory/x/logrusx"
"github.com/ory/x/otelx"
"github.com/ory/x/sqlcon"
)
const (
Pending = "Pending"
Applied = "Applied"
tracingComponent = "github.com/ory/x/popx"
)
func (mb *MigrationBox) shouldNotUseTransaction(m Migration) bool {
return m.Autocommit || mb.noTxDDL()
}
// Up runs pending "up" migrations and applies them to the database.
func (mb *MigrationBox) Up(ctx context.Context) error {
_, err := mb.UpTo(ctx, 0)
return errors.WithStack(err)
}
// sqliteTemplatePath computes the path of the SQLite template for this
// migration set. The path is deterministic and content-addressed, so a changed
// migration set cannot reuse an older template.
func (mb *MigrationBox) sqliteTemplatePath() string {
mfs := mb.migrationsUp.sortAndFilter(mb.c.Dialect.Name(), mb.migrationFallbacks()...)
h := sha256.New()
for _, mi := range mfs {
for _, part := range []string{
mi.Version,
mi.Path,
mi.Name,
mi.Direction,
mi.Type,
mi.DBType,
mi.Content,
} {
_, _ = h.Write([]byte(part))
_, _ = h.Write([]byte{0})
}
}
dir := mb.sqliteTemplateCacheDir
if dir == "" {
dir = os.TempDir()
}
return filepath.Join(dir, "ory-popx-sqlite-template-"+hex.EncodeToString(h.Sum(nil))+".sqlite")
}
// restoreSQLiteOnline streams the contents of srcPath into the database
// represented by db using SQLite's online backup API. The destination
// connection stays open throughout, so the *sql.DB and any pop.Connection
// holding it remain valid.
//
// pop wraps the modernc.org/sqlite driver with otelsql for tracing; we
// unwrap via the otelsql Raw() accessor before reaching the driver-specific
// NewRestore method on the underlying *sqlite.conn.
func restoreSQLiteOnline(ctx context.Context, db *sql.DB, srcPath string) error {
conn, err := db.Conn(ctx)
if err != nil {
return errors.Wrap(err, "failed to acquire sql.Conn for restore")
}
defer func() { _ = conn.Close() }()
return conn.Raw(func(driverConn any) error {
if w, ok := driverConn.(interface{ Raw() driver.Conn }); ok {
driverConn = w.Raw()
}
restorer, ok := driverConn.(interface {
NewRestore(srcUri string) (*moderncsqlite.Backup, error)
})
if !ok {
return errors.Errorf("driver %T does not support online restore", driverConn)
}
// See: https://sqlite.org/backup.html .
backup, err := restorer.NewRestore(srcPath)
if err != nil {
return errors.Wrap(err, "NewRestore failed")
}
// Step(-1) copies all remaining pages in one call.
for {
more, stepErr := backup.Step(-1)
if stepErr != nil {
_ = backup.Finish()
return errors.Wrap(stepErr, "backup.Step failed")
}
if !more {
break
}
}
return errors.Wrap(backup.Finish(), "backup.Finish failed")
})
}
// UpTo runs up to step "up" migrations and applies them to the database.
// If step <= 0 all pending migrations are run.
func (mb *MigrationBox) UpTo(ctx context.Context, step int) (applied int, err error) {
ctx, span := startSpan(ctx, MigrationUpOpName, trace.WithAttributes(attribute.Int("step", step)))
defer otelx.End(span, &err)
c := mb.c.WithContext(ctx)
newDbFileName, isOnDiskSQLite := sqliteFilePath(mb.c.URL())
isSQLite := mb.c.Dialect.Name() == "sqlite3"
isOnDiskSQLite = isSQLite && isOnDiskSQLite
// For test SQLite databases, try to restore a pre-migrated template
// using SQLite's online backup API. The restore streams pages directly into
// the open connection, so mb.c stays valid throughout and any holders of
// it (including WithContext copies) keep working.
if testing.Testing() && isOnDiskSQLite && step <= 0 && !mb.disableGoldenDatabase {
templatePath := mb.sqliteTemplatePath()
// Only restore onto a fresh (uninitialized) database. If the
// migration table already exists, migrations were previously applied
// — either directly or via an earlier template restore.
mtn := sanitizedMigrationTableName(mb.c)
var existingTableCount int
alreadyMigrated := mb.c.Store.SQLDB().QueryRow(
"SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND name=?", mtn,
).Scan(&existingTableCount) == nil && existingTableCount > 0
if !alreadyMigrated {
if mkdirErr := os.MkdirAll(filepath.Dir(templatePath), 0o750); mkdirErr != nil {
mb.l.Errorf("Failed to create SQLite template cache directory, applying migrations: path=%s err=%v", filepath.Dir(templatePath), mkdirErr)
} else {
// Test packages run as separate processes. Serialize the first
// template build so only one of them pays the migration cost;
// waiters restore the completed template after acquiring the
// lock. The template itself is still installed atomically.
lock := flock.New(templatePath + ".lock")
if lockErr := lock.Lock(); lockErr != nil {
mb.l.Errorf("Failed to lock SQLite template, applying migrations: path=%s err=%v", templatePath, lockErr)
} else {
defer func() {
if unlockErr := lock.Unlock(); unlockErr != nil {
mb.l.Errorf("Failed to unlock SQLite template: path=%s err=%v", templatePath, unlockErr)
}
}()
}
}
if _, statErr := os.Stat(templatePath); statErr == nil {
if restoreErr := restoreSQLiteOnline(ctx, mb.c.Store.SQLDB(), templatePath); restoreErr != nil {
// Restore failed; log and fall through to the normal migration path.
mb.l.Errorf("Failed to restore SQLite template, applying migrations: src=%s dst=%s err=%v", templatePath, newDbFileName, restoreErr)
} else {
mfs := mb.migrationsUp.sortAndFilter(mb.c.Dialect.Name(), mb.migrationFallbacks()...)
mb.l.Infof("Skipped applying %d migrations using SQLite template: path=%s", len(mfs), templatePath)
return len(mfs), nil
}
} else if !errors.Is(statErr, os.ErrNotExist) {
mb.l.Errorf("Failed to inspect SQLite template, applying migrations: path=%s err=%v", templatePath, statErr)
}
}
}
// Keep applied across whole-run retry attempts. Every migration counted here
// has already committed its schema_migration row, so it remains part of this
// UpTo call's step budget even when a later migration retries.
err = mb.exec(ctx, func() error {
mtn := sanitizedMigrationTableName(c)
mfs := mb.migrationsUp.sortAndFilter(mb.c.Dialect.Name(), mb.migrationFallbacks()...)
for _, mi := range mfs {
l := mb.l.WithField("version", mi.Version).WithField("migration_name", mi.Name).WithField("migration_file", mi.Path)
appliedMigrations := make([]string, 0, 2)
legacyVersion := mi.Version
if len(legacyVersion) > 14 {
legacyVersion = legacyVersion[:14]
}
err := c.RawQuery(fmt.Sprintf("SELECT version FROM %s WHERE version IN (?, ?)", mtn), mi.Version, legacyVersion).All(&appliedMigrations)
if err != nil {
return errors.Wrapf(err, "problem checking for migration version %s", mi.Version)
}
if slices.Contains(appliedMigrations, mi.Version) {
l.Debug("Migration has already been applied, skipping.")
continue
}
if slices.Contains(appliedMigrations, legacyVersion) {
l.WithField("legacy_version", legacyVersion).WithField("migration_table", mtn).Debug("Migration has already been applied in a legacy migration run. Updating version in migration table.")
if err := mb.isolatedTransaction(ctx, "init-migrate", func(conn *pop.Connection) error {
// We do not want to remove the legacy migration version or subsequent migrations might be applied twice.
//
// Do not activate the following - it is just for reference.
//
// if _, err := tx.Store.Exec(fmt.Sprintf("DELETE FROM %s WHERE version = ?", mtn), legacyVersion); err != nil {
// return errors.Wrapf(err, "problem removing legacy version %s", mi.Version)
// }
// #nosec G201 - mtn is a system-wide const
err := conn.RawQuery(fmt.Sprintf("INSERT INTO %s (version) VALUES (?)", mtn), mi.Version).Exec()
return errors.Wrapf(err, "problem inserting migration version %s", mi.Version)
}); err != nil {
return errors.WithStack(err)
}
continue
}
l.Info("Migration has not yet been applied, running migration.")
if err := mi.Valid(); err != nil {
return errors.WithStack(err)
}
noTx := mb.shouldNotUseTransaction(mi)
if noTx {
l.Info("NOT running migrations inside a transaction")
if err := mi.Runner(mi, c); err != nil {
return errors.WithStack(err)
}
// #nosec G201 - mtn is a system-wide const
if err := c.RawQuery(fmt.Sprintf("INSERT INTO %s (version) VALUES (?)", mtn), mi.Version).Exec(); err != nil {
return errors.Wrapf(err, "problem inserting migration version %s. YOUR DATABASE MAY BE IN AN INCONSISTENT STATE! MANUAL INTERVENTION REQUIRED!", mi.Version)
}
} else {
if err := mb.isolatedTransaction(ctx, "up", func(conn *pop.Connection) error {
if err := mi.Runner(mi, conn); err != nil {
return errors.WithStack(err)
}
// #nosec G201 - mtn is a system-wide const
if err := conn.RawQuery(fmt.Sprintf("INSERT INTO %s (version) VALUES (?)", mtn), mi.Version).Exec(); err != nil {
return errors.Wrapf(err, "problem inserting migration version %s", mi.Version)
}
return nil
}); err != nil {
return errors.WithStack(err)
}
}
l.WithField("autocommit", noTx).Infof("> %s applied successfully", mi.Name)
applied++
if step > 0 && applied >= step {
break
}
}
if applied == 0 {
mb.l.Infof("Migrations already up to date, nothing to apply")
} else {
mb.l.Infof("Successfully applied %d migrations.", applied)
}
// Save a SQLite template after applying all migrations (not for
// partial step runs) so future test runs can skip migrations.
//
// Only save when at least one migration was applied. Saving when
// applied == 0 either captures an empty DB or an already-migrated
// one that may contain test data inserted by an earlier registry
// (e.g. the Hydra janitor reuses the same DSN), which would
// pollute the shared template.
//
// Use VACUUM INTO to produce a clean, fully-checkpointed copy
// without a separate wal_checkpoint step. Write to a temp path
// unique to this test's database, then atomically rename to the
// shared template path. This prevents concurrent saves from
// multiple parallel tests from corrupting the template:
// os.Rename is atomic on the same filesystem, so the last writer
// wins with valid content and no reader ever sees a partial file.
if isOnDiskSQLite && step <= 0 && !mb.disableGoldenDatabase && applied > 0 {
templatePath := mb.sqliteTemplatePath()
tmp, err := os.CreateTemp(filepath.Dir(templatePath), ".sqlite-template-*.sqlite")
if err != nil {
mb.l.Errorf("Failed to allocate SQLite template file: err=%v", err)
return nil
}
tmpPath := tmp.Name()
if closeErr := tmp.Close(); closeErr != nil {
_ = os.Remove(tmpPath)
mb.l.Errorf("Failed to close SQLite template file: err=%v", closeErr)
return nil
}
// VACUUM INTO requires that the destination does not exist.
if removeErr := os.Remove(tmpPath); removeErr != nil {
mb.l.Errorf("Failed to prepare SQLite template file: err=%v", removeErr)
return nil
}
defer func() { _ = os.Remove(tmpPath) }()
// #nosec G201 - tmpPath is under os.TempDir() with a
// hex-hash filename, never derived from user input.
vacuumSQL := fmt.Sprintf("VACUUM INTO '%s'", strings.ReplaceAll(tmpPath, "'", "''"))
if err := mb.c.RawQuery(vacuumSQL).Exec(); err != nil {
mb.l.Errorf("Failed to create SQLite template copy: err=%v", err)
} else if err := os.Rename(tmpPath, templatePath); err != nil {
_ = os.Remove(tmpPath)
mb.l.Errorf("Failed to install SQLite template: src=%s dst=%s err=%v", tmpPath, templatePath, err)
} else {
mfs := mb.migrationsUp.sortAndFilter(mb.c.Dialect.Name(), mb.migrationFallbacks()...)
mb.l.Infof("SQLite template saved, subsequent test runs will skip %d migrations: path=%s", len(mfs), templatePath)
}
}
return nil
})
return applied, errors.WithStack(err)
}
// Down runs pending "down" migrations and rolls back the
// database by the specified number of steps.
// If step <= 0, all down migrations are run.
func (mb *MigrationBox) Down(ctx context.Context, steps int) (err error) {
ctx, span := startSpan(ctx, MigrationDownOpName, trace.WithAttributes(attribute.Int("steps", steps)))
defer otelx.End(span, &err)
if steps <= 0 {
steps = math.MaxInt
}
remainingSteps := steps
c := mb.c.WithContext(ctx)
return errors.WithStack(mb.exec(ctx, func() (err error) {
mtn := sanitizedMigrationTableName(c)
count, err := c.Count(mtn)
if err != nil {
return errors.Wrap(err, "migration down: unable count existing migration")
}
attemptSteps := min(remainingSteps, count)
mfs := mb.migrationsDown.sortAndFilter(mb.c.Dialect.Name(), mb.migrationFallbacks()...)
slices.Reverse(mfs)
if len(mfs) > count {
// skip all migrations that were not yet applied
mfs = mfs[len(mfs)-count:]
}
reverted := 0
defer func() {
migrationsToRevertCount := min(attemptSteps, len(mfs))
mb.l.Debugf("Successfully reverted %d/%d migrations.", reverted, migrationsToRevertCount)
if err != nil {
mb.l.WithError(err).Error("Problem reverting migrations.")
}
}()
for i, mi := range mfs {
if i >= attemptSteps {
break
}
l := mb.l.WithField("version", mi.Version).WithField("migration_name", mi.Name).WithField("migration_file", mi.Path)
l.Debugf("handling migration %s", mi.Name)
exists, err := c.Where("version = ?", mi.Version).Exists(mtn)
if err != nil {
return errors.Wrapf(err, "problem checking for migration version %s", mi.Version)
}
if !exists && len(mi.Version) > 14 {
legacyVersion := mi.Version[:14]
legacyVersionExists, err := c.Where("version = ?", legacyVersion).Exists(mtn)
if err != nil {
return errors.Wrapf(err, "problem checking for legacy migration version %s", legacyVersion)
}
if !legacyVersionExists {
return errors.Errorf("neither normal (%s) nor legacy migration (%s) exist", mi.Version, legacyVersion)
}
} else if !exists {
return errors.Errorf("migration version %s does not exist", mi.Version)
}
if err := mi.Valid(); err != nil {
return errors.WithStack(err)
}
if mb.shouldNotUseTransaction(mi) {
err := mi.Runner(mi, c)
if err != nil {
return errors.WithStack(err)
}
// #nosec G201 - mtn is a system-wide const
if err := c.RawQuery(fmt.Sprintf("DELETE FROM %s WHERE version = ?", mtn), mi.Version).Exec(); err != nil {
return errors.Wrapf(err, "problem deleting migration version %s. YOUR DATABASE MAY BE IN AN INCONSISTENT STATE! MANUAL INTERVENTION REQUIRED!", mi.Version)
}
} else {
if err := mb.isolatedTransaction(ctx, "down", func(conn *pop.Connection) error {
err := mi.Runner(mi, conn)
if err != nil {
return errors.WithStack(err)
}
// #nosec G201 - mtn is a system-wide const
if err := conn.RawQuery(fmt.Sprintf("DELETE FROM %s WHERE version = ?", mtn), mi.Version).Exec(); err != nil {
return errors.Wrapf(err, "problem deleting migration version %s", mi.Version)
}
return nil
}); err != nil {
return errors.WithStack(err)
}
}
l.Infof("%s applied successfully", mi.Name)
reverted++
remainingSteps--
}
return nil
}))
}
func (mb *MigrationBox) createTransactionalMigrationTable(ctx context.Context, c *pop.Connection, l *logrusx.Logger) error {
mtn := sanitizedMigrationTableName(c)
if err := mb.createMigrationStatusTableTransaction(ctx, []string{
fmt.Sprintf(`CREATE TABLE %s (version VARCHAR (48) NOT NULL, version_self INT NOT NULL DEFAULT 0)`, mtn),
fmt.Sprintf(`CREATE UNIQUE INDEX %s_version_idx ON %s (version)`, mtn, mtn),
fmt.Sprintf(`CREATE INDEX %s_version_self_idx ON %s (version_self)`, mtn, mtn),
}); err != nil {
return errors.WithStack(err)
}
l.WithField("migration_table", mtn).Debug("Transactional migration table created successfully.")
return nil
}
func (mb *MigrationBox) migrateToTransactionalMigrationTable(ctx context.Context, c *pop.Connection, l *logrusx.Logger) error {
// This means the new pop migrator has also not yet been applied, do that now.
mtn := sanitizedMigrationTableName(c)
withOn := fmt.Sprintf(" ON %s", mtn)
if c.Dialect.Name() != "mysql" {
withOn = ""
}
interimTable := fmt.Sprintf("%s_transactional", mtn)
workload := [][]string{
{
fmt.Sprintf(`DROP INDEX %s_version_idx%s`, mtn, withOn),
fmt.Sprintf(`CREATE TABLE %s (version VARCHAR (48) NOT NULL, version_self INT NOT NULL DEFAULT 0)`, interimTable),
fmt.Sprintf(`CREATE UNIQUE INDEX %s_version_idx ON %s (version)`, mtn, interimTable),
fmt.Sprintf(`CREATE INDEX %s_version_self_idx ON %s (version_self)`, mtn, interimTable),
// #nosec G201 - mtn is a system-wide const
fmt.Sprintf(`INSERT INTO %s (version) SELECT version FROM %s`, interimTable, mtn),
fmt.Sprintf(`ALTER TABLE %s RENAME TO %s_pop_legacy`, mtn, mtn),
},
{
fmt.Sprintf(`ALTER TABLE %s RENAME TO %s`, interimTable, mtn),
},
}
if err := mb.createMigrationStatusTableTransaction(ctx, workload...); err != nil {
return errors.WithStack(err)
}
l.WithField("migration_table", mtn).Debug("Successfully migrated legacy schema_migration to new transactional schema_migration table.")
return nil
}
func (mb *MigrationBox) isolatedTransaction(ctx context.Context, direction string, fn func(c *pop.Connection) error) (err error) {
ctx, span := startSpan(ctx, MigrationRunTransactionOpName, trace.WithAttributes(attribute.String("migration_direction", direction)))
defer otelx.End(span, &err)
if mb.perMigrationTimeout > 0 {
var cancel context.CancelFunc
ctx, cancel = context.WithTimeoutCause(ctx, mb.perMigrationTimeout, errors.Errorf("failed to run all SQL migrations: direction=%s timeout=%s", direction, mb.perMigrationTimeout))
defer cancel()
}
return Transaction(ctx, mb.c.WithContext(ctx), func(ctx context.Context, connection *pop.Connection) error {
return errors.WithStack(fn(connection))
})
}
func (mb *MigrationBox) createMigrationStatusTableTransaction(ctx context.Context, transactions ...[]string) error {
for _, statements := range transactions {
// CockroachDB does not support transactional schema changes, so we have to run
// the statements outside of a transaction. The same applies to any dialect
// that opts into autocommit DDL (see noTxDDL).
if mb.noTxDDL() {
for _, statement := range statements {
if err := mb.c.WithContext(ctx).RawQuery(statement).Exec(); err != nil {
return errors.Wrapf(err, "unable to execute statement: %s", statement)
}
}
} else {
if err := mb.isolatedTransaction(ctx, "init", func(conn *pop.Connection) error {
for _, statement := range statements {
if err := conn.WithContext(ctx).RawQuery(statement).Exec(); err != nil {
return errors.Wrapf(err, "unable to execute statement: %s", statement)
}
}
return nil
}); err != nil {
return errors.WithStack(err)
}
}
}
return nil
}
// CreateSchemaMigrations sets up a table to track migrations. This is an idempotent
// operation.
func (mb *MigrationBox) CreateSchemaMigrations(ctx context.Context) error {
ctx, span := startSpan(ctx, MigrationInitOpName)
defer span.End()
c := mb.c.WithContext(ctx)
mtn := sanitizedMigrationTableName(c)
mb.l.WithField("migration_table", mtn).Debug("Checking if legacy migration table exists.")
_, err := c.Store.Exec(fmt.Sprintf("select version from %s", mtn))
if err != nil {
mb.l.WithError(err).WithField("migration_table", mtn).Debug("An error occurred while checking for the legacy migration table, maybe it does not exist yet? Trying to create.")
// This means that the legacy pop migrator has not yet been applied
return errors.WithStack(mb.createTransactionalMigrationTable(ctx, c, mb.l))
}
mb.l.WithField("migration_table", mtn).Debug("A migration table exists, checking if it is a transactional migration table.")
_, err = c.Store.Exec(fmt.Sprintf("select version, version_self from %s", mtn))
if err != nil {
mb.l.WithError(err).WithField("migration_table", mtn).Debug("An error occurred while checking for the transactional migration table, maybe it does not exist yet? Trying to create.")
return errors.WithStack(mb.migrateToTransactionalMigrationTable(ctx, c, mb.l))
}
mb.l.WithField("migration_table", mtn).Debug("Migration tables exist and are up to date.")
return nil
}
type MigrationStatus struct {
State string `json:"state"`
Version string `json:"version"`
Name string `json:"name"`
ContentUp string `json:"content"`
ContentDown string `json:"content_down"`
}
type MigrationStatuses []MigrationStatus
var _ cmdx.Table = (MigrationStatuses)(nil)
func (m MigrationStatuses) Header() []string {
return []string{"Version", "Name", "Status"}
}
func (m MigrationStatuses) Table() [][]string {
t := make([][]string, len(m))
for i, s := range m {
t[i] = []string{s.Version, s.Name, s.State}
}
return t
}
func (m MigrationStatuses) Interface() interface{} {
return m
}
func (m MigrationStatuses) Len() int {
return len(m)
}
func (m MigrationStatuses) IDs() []string {
ids := make([]string, len(m))
for i, s := range m {
ids[i] = s.Version
}
return ids
}
func (m MigrationStatuses) HasPending() bool {
for _, mm := range m {
if mm.State == Pending {
return true
}
}
return false
}
func sanitizedMigrationTableName(con *pop.Connection) string {
return regexp.MustCompile(`\W`).ReplaceAllString(con.MigrationTableName(), "")
}
func errIsTableNotFound(err error) bool {
return strings.Contains(err.Error(), "no such table:") || // sqlite
strings.Contains(err.Error(), "Error 1146") || // MySQL
strings.Contains(err.Error(), "SQLSTATE 42P01") // PostgreSQL / CockroachDB
}
// Status prints out the status of applied/pending migrations.
func (mb *MigrationBox) Status(ctx context.Context) (MigrationStatuses, error) {
ctx, span := startSpan(ctx, MigrationStatusOpName)
defer span.End()
con := mb.c.WithContext(ctx)
dialect := mb.c.Dialect.Name()
fallbacks := mb.migrationFallbacks()
migrationsUp := mb.migrationsUp.sortAndFilter(dialect, fallbacks...)
if len(migrationsUp) == 0 {
return nil, errors.Errorf("unable to find any migrations for dialect: %s", dialect)
}
alreadyApplied := make([]string, 0, len(migrationsUp))
err := con.RawQuery(fmt.Sprintf("SELECT version FROM %s", sanitizedMigrationTableName(con))).All(&alreadyApplied)
if err != nil {
if errIsTableNotFound(err) {
// This means that no migrations have been applied and we need to apply all of them first!
//
// It also means that we can ignore this state and act as if no migrations have been applied yet.
} else {
// On any other error, we fail.
return nil, errors.Wrap(err, "problem with migration")
}
}
statuses := make(MigrationStatuses, len(migrationsUp))
for k, mf := range migrationsUp {
downContent := "-- error: no down migration defined for this migration"
if mDown := mb.migrationsDown.find(mf.Version, dialect, fallbacks...); mDown != nil {
downContent = mDown.Content
}
statuses[k] = MigrationStatus{
State: Pending,
Version: mf.Version,
Name: mf.Name,
ContentUp: mf.Content,
ContentDown: downContent,
}
if slices.ContainsFunc(alreadyApplied, func(applied string) bool {
return applied == mf.Version || (len(mf.Version) > 14 && applied == mf.Version[:14])
}) {
statuses[k].State = Applied
continue
}
}
return statuses, nil
}
// DumpMigrationSchema will generate a file of the current database schema
func (mb *MigrationBox) DumpMigrationSchema(ctx context.Context) error {
c := mb.c.WithContext(ctx)
schema := "schema.sql"
f, err := os.Create(schema) //#nosec:G304
if err != nil {
return errors.WithStack(err)
}
err = c.Dialect.DumpSchema(f)
if err != nil {
_ = os.RemoveAll(schema)
return errors.WithStack(err)
}
return nil
}
func (mb *MigrationBox) exec(ctx context.Context, fn func() error) error {
now := time.Now()
defer mb.printTimer(now)
err := mb.CreateSchemaMigrations(ctx)
if err != nil {
return errors.Wrap(err, "migrator: problem creating schema migrations")
}
if mb.c.Dialect.Name() == "sqlite3" {
if err := mb.c.RawQuery("PRAGMA foreign_keys=OFF").Exec(); err != nil {
return sqlcon.HandleError(err)
}
}
switch mb.c.Dialect.Name() {
case dbal.DriverCockroachDB, dbal.DriverYugabyteDB:
outer := fn
fn = func() error {
// CreateSchemaMigrations runs before this wrapper. YugabyteDB uses
// autocommit DDL, but its pgwire errors expose the same retryable
// SQLSTATEs that crdb.Execute classifies for whole-run retries.
return errors.WithStack(crdb.Execute(outer))
}
}
if err := fn(); err != nil {
return errors.WithStack(err)
}
if mb.c.Dialect.Name() == "sqlite3" {
if err := mb.c.RawQuery("PRAGMA foreign_keys=ON").Exec(); err != nil {
return sqlcon.HandleError(err)
}
}
return nil
}
func (mb *MigrationBox) printTimer(timerStart time.Time) {
diff := time.Since(timerStart).Seconds()
if diff > 60 {
mb.l.Debugf("%.4f minutes", diff/60)
} else {
mb.l.Debugf("%.4f seconds", diff)
}
}

22
oryx/popx/span.go Normal file
View File

@@ -0,0 +1,22 @@
// Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package popx
import (
"context"
"go.opentelemetry.io/otel/trace"
)
const (
MigrationStatusOpName = "migration-status"
MigrationInitOpName = "migration-init"
MigrationUpOpName = "migration-up"
MigrationRunTransactionOpName = "migration-run-transaction"
MigrationDownOpName = "migration-down"
)
func startSpan(ctx context.Context, opName string, opts ...trace.SpanStartOption) (context.Context, trace.Span) {
return trace.SpanFromContext(ctx).TracerProvider().Tracer(tracingComponent).Start(ctx, opName, opts...)
}

View File

@@ -0,0 +1,23 @@
// Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package popx
import (
"regexp"
"github.com/pkg/errors"
)
var SQLTemplateFuncs = map[string]interface{}{
"identifier": Identifier,
}
var identifierPattern = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_]*$")
func Identifier(i string) (string, error) {
if !identifierPattern.MatchString(i) {
return "", errors.Errorf("invalid SQL identifier '%s'", i)
}
return i, nil
}

View File

@@ -0,0 +1,88 @@
// Copyright © 2026 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package popx
import (
"context"
"io/fs"
"os"
"path/filepath"
"strings"
"testing"
"github.com/pkg/errors"
"github.com/ory/pop/v6"
"github.com/ory/x/logrusx"
)
// sqliteFilePath returns the absolute file path for an on-disk SQLite DSN.
// SQLite memory databases and non-SQLite DSNs return ("", false).
func sqliteFilePath(dsn string) (string, bool) {
rest := dsn
if scheme, afterScheme, ok := strings.Cut(dsn, "://"); ok {
if scheme != "sqlite" && scheme != "sqlite3" {
return "", false
}
rest = afterScheme
}
if strings.Contains(rest, ":memory:") || strings.Contains(rest, "mode=memory") {
return "", false
}
rest = strings.TrimPrefix(rest, "file:")
if i := strings.IndexByte(rest, '?'); i >= 0 {
rest = rest[:i]
}
if !filepath.IsAbs(rest) {
return "", false
}
return rest, true
}
// PrepareTestSQLiteDatabase migrates a fresh on-disk SQLite test database
// before the application opens it. MigrationBox's shared template cache makes
// this a cheap template restore after the first migration set has been built.
//
// This is useful when an application normally applies multiple migration sets
// in separate passes: pass their merged filesystem here so the cached template
// represents the final combined schema. Non-SQLite DSNs, memory databases, and
// existing database files are left untouched.
func PrepareTestSQLiteDatabase(
ctx context.Context,
dsn string,
migrations fs.FS,
logger *logrusx.Logger,
opts ...MigrationBoxOption,
) error {
if !testing.Testing() {
return nil
}
path, ok := sqliteFilePath(dsn)
if !ok {
return nil
}
if _, err := os.Stat(path); err == nil {
return nil
} else if !errors.Is(err, os.ErrNotExist) {
return errors.WithStack(err)
}
c, err := pop.NewConnection(&pop.ConnectionDetails{URL: dsn})
if err != nil {
return errors.WithStack(err)
}
if err := c.Open(); err != nil {
return errors.WithStack(err)
}
mb, err := NewMigrationBox(migrations, c, logger, opts...)
if err == nil {
err = mb.Up(ctx)
}
closeErr := c.Close()
if err != nil {
return errors.WithStack(err)
}
return errors.WithStack(closeErr)
}

View File

@@ -0,0 +1,4 @@
DROP TABLE "identity_credential_identifiers";COMMIT TRANSACTION;BEGIN TRANSACTION;
DROP TABLE "identity_credentials";COMMIT TRANSACTION;BEGIN TRANSACTION;
DROP TABLE "identity_credential_types";COMMIT TRANSACTION;BEGIN TRANSACTION;
DROP TABLE "identities";COMMIT TRANSACTION;BEGIN TRANSACTION;

View File

@@ -0,0 +1,35 @@
CREATE TABLE "identities" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"traits_schema_id" VARCHAR (2048) NOT NULL,
"traits" json NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL
);COMMIT TRANSACTION;BEGIN TRANSACTION;
CREATE TABLE "identity_credential_types" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"name" VARCHAR (32) NOT NULL
);COMMIT TRANSACTION;BEGIN TRANSACTION;
CREATE UNIQUE INDEX "identity_credential_types_name_idx" ON "identity_credential_types" (name);COMMIT TRANSACTION;BEGIN TRANSACTION;
CREATE TABLE "identity_credentials" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"config" json NOT NULL,
"identity_credential_type_id" UUID NOT NULL,
"identity_id" UUID NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL,
CONSTRAINT "identity_credentials_identities_id_fk" FOREIGN KEY ("identity_id") REFERENCES "identities" ("id") ON DELETE cascade,
CONSTRAINT "identity_credentials_identity_credential_types_id_fk" FOREIGN KEY ("identity_credential_type_id") REFERENCES "identity_credential_types" ("id") ON DELETE cascade
);COMMIT TRANSACTION;BEGIN TRANSACTION;
CREATE TABLE "identity_credential_identifiers" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"identifier" VARCHAR (255) NOT NULL,
"identity_credential_id" UUID NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL,
CONSTRAINT "identity_credential_identifiers_identity_credentials_id_fk" FOREIGN KEY ("identity_credential_id") REFERENCES "identity_credentials" ("id") ON DELETE cascade
);COMMIT TRANSACTION;BEGIN TRANSACTION;
CREATE UNIQUE INDEX "identity_credential_identifiers_identifier_idx" ON "identity_credential_identifiers" (identifier);COMMIT TRANSACTION;BEGIN TRANSACTION;

View File

@@ -0,0 +1,4 @@
DROP TABLE `identity_credential_identifiers`;
DROP TABLE `identity_credentials`;
DROP TABLE `identity_credential_types`;
DROP TABLE `identities`;

View File

@@ -0,0 +1,35 @@
CREATE TABLE `identities` (
`id` char(36) NOT NULL,
PRIMARY KEY(`id`),
`traits_schema_id` VARCHAR (2048) NOT NULL,
`traits` JSON NOT NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL
) ENGINE=InnoDB;
CREATE TABLE `identity_credential_types` (
`id` char(36) NOT NULL,
PRIMARY KEY(`id`),
`name` VARCHAR (32) NOT NULL
) ENGINE=InnoDB;
CREATE UNIQUE INDEX `identity_credential_types_name_idx` ON `identity_credential_types` (`name`);
CREATE TABLE `identity_credentials` (
`id` char(36) NOT NULL,
PRIMARY KEY(`id`),
`config` JSON NOT NULL,
`identity_credential_type_id` char(36) NOT NULL,
`identity_id` char(36) NOT NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL,
FOREIGN KEY (`identity_id`) REFERENCES `identities` (`id`) ON DELETE cascade,
FOREIGN KEY (`identity_credential_type_id`) REFERENCES `identity_credential_types` (`id`) ON DELETE cascade
) ENGINE=InnoDB;
CREATE TABLE `identity_credential_identifiers` (
`id` char(36) NOT NULL,
PRIMARY KEY(`id`),
`identifier` VARCHAR (255) NOT NULL,
`identity_credential_id` char(36) NOT NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL,
FOREIGN KEY (`identity_credential_id`) REFERENCES `identity_credentials` (`id`) ON DELETE cascade
) ENGINE=InnoDB;
CREATE UNIQUE INDEX `identity_credential_identifiers_identifier_idx` ON `identity_credential_identifiers` (`identifier`);

View File

@@ -0,0 +1,4 @@
DROP TABLE "identity_credential_identifiers";
DROP TABLE "identity_credentials";
DROP TABLE "identity_credential_types";
DROP TABLE "identities";

View File

@@ -0,0 +1,35 @@
CREATE TABLE "identities" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"traits_schema_id" VARCHAR (2048) NOT NULL,
"traits" jsonb NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL
);
CREATE TABLE "identity_credential_types" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"name" VARCHAR (32) NOT NULL
);
CREATE UNIQUE INDEX "identity_credential_types_name_idx" ON "identity_credential_types" (name);
CREATE TABLE "identity_credentials" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"config" jsonb NOT NULL,
"identity_credential_type_id" UUID NOT NULL,
"identity_id" UUID NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL,
FOREIGN KEY ("identity_id") REFERENCES "identities" ("id") ON DELETE cascade,
FOREIGN KEY ("identity_credential_type_id") REFERENCES "identity_credential_types" ("id") ON DELETE cascade
);
CREATE TABLE "identity_credential_identifiers" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"identifier" VARCHAR (255) NOT NULL,
"identity_credential_id" UUID NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL,
FOREIGN KEY ("identity_credential_id") REFERENCES "identity_credentials" ("id") ON DELETE cascade
);
CREATE UNIQUE INDEX "identity_credential_identifiers_identifier_idx" ON "identity_credential_identifiers" (identifier);

View File

@@ -0,0 +1,4 @@
DROP TABLE "identity_credential_identifiers";
DROP TABLE "identity_credentials";
DROP TABLE "identity_credential_types";
DROP TABLE "identities";

View File

@@ -0,0 +1,31 @@
CREATE TABLE "identities" (
"id" TEXT PRIMARY KEY,
"traits_schema_id" TEXT NOT NULL,
"traits" TEXT NOT NULL,
"created_at" DATETIME NOT NULL,
"updated_at" DATETIME NOT NULL
);
CREATE TABLE "identity_credential_types" (
"id" TEXT PRIMARY KEY,
"name" TEXT NOT NULL
);
CREATE UNIQUE INDEX "identity_credential_types_name_idx" ON "identity_credential_types" (name);
CREATE TABLE "identity_credentials" (
"id" TEXT PRIMARY KEY,
"config" TEXT NOT NULL,
"identity_credential_type_id" char(36) NOT NULL,
"identity_id" char(36) NOT NULL,
"created_at" DATETIME NOT NULL,
"updated_at" DATETIME NOT NULL,
FOREIGN KEY (identity_id) REFERENCES identities (id) ON DELETE cascade,
FOREIGN KEY (identity_credential_type_id) REFERENCES identity_credential_types (id) ON DELETE cascade
);
CREATE TABLE "identity_credential_identifiers" (
"id" TEXT PRIMARY KEY,
"identifier" TEXT NOT NULL,
"identity_credential_id" char(36) NOT NULL,
"created_at" DATETIME NOT NULL,
"updated_at" DATETIME NOT NULL,
FOREIGN KEY (identity_credential_id) REFERENCES identity_credentials (id) ON DELETE cascade
);
CREATE UNIQUE INDEX "identity_credential_identifiers_identifier_idx" ON "identity_credential_identifiers" (identifier);

View File

@@ -0,0 +1,5 @@
DROP TABLE "selfservice_login_request_methods";COMMIT TRANSACTION;BEGIN TRANSACTION;
DROP TABLE "selfservice_login_requests";COMMIT TRANSACTION;BEGIN TRANSACTION;
DROP TABLE "selfservice_registration_request_methods";COMMIT TRANSACTION;BEGIN TRANSACTION;
DROP TABLE "selfservice_registration_requests";COMMIT TRANSACTION;BEGIN TRANSACTION;
DROP TABLE "selfservice_profile_management_requests";COMMIT TRANSACTION;BEGIN TRANSACTION;

View File

@@ -0,0 +1,55 @@
CREATE TABLE "selfservice_login_requests" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"request_url" VARCHAR (2048) NOT NULL,
"issued_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expires_at" timestamp NOT NULL,
"active_method" VARCHAR (32) NOT NULL,
"csrf_token" VARCHAR (255) NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL
);COMMIT TRANSACTION;BEGIN TRANSACTION;
CREATE TABLE "selfservice_login_request_methods" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"method" VARCHAR (32) NOT NULL,
"selfservice_login_request_id" UUID NOT NULL,
"config" json NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL,
CONSTRAINT "selfservice_login_request_methods_selfservice_login_requests_id_fk" FOREIGN KEY ("selfservice_login_request_id") REFERENCES "selfservice_login_requests" ("id") ON DELETE cascade
);COMMIT TRANSACTION;BEGIN TRANSACTION;
CREATE TABLE "selfservice_registration_requests" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"request_url" VARCHAR (2048) NOT NULL,
"issued_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expires_at" timestamp NOT NULL,
"active_method" VARCHAR (32) NOT NULL,
"csrf_token" VARCHAR (255) NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL
);COMMIT TRANSACTION;BEGIN TRANSACTION;
CREATE TABLE "selfservice_registration_request_methods" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"method" VARCHAR (32) NOT NULL,
"selfservice_registration_request_id" UUID NOT NULL,
"config" json NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL,
CONSTRAINT "selfservice_registration_request_methods_selfservice_registration_requests_id_fk" FOREIGN KEY ("selfservice_registration_request_id") REFERENCES "selfservice_registration_requests" ("id") ON DELETE cascade
);COMMIT TRANSACTION;BEGIN TRANSACTION;
CREATE TABLE "selfservice_profile_management_requests" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"request_url" VARCHAR (2048) NOT NULL,
"issued_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expires_at" timestamp NOT NULL,
"form" json NOT NULL,
"update_successful" bool NOT NULL,
"identity_id" UUID NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL,
CONSTRAINT "selfservice_profile_management_requests_identities_id_fk" FOREIGN KEY ("identity_id") REFERENCES "identities" ("id") ON DELETE cascade
);COMMIT TRANSACTION;BEGIN TRANSACTION;

View File

@@ -0,0 +1,5 @@
DROP TABLE `selfservice_login_request_methods`;
DROP TABLE `selfservice_login_requests`;
DROP TABLE `selfservice_registration_request_methods`;
DROP TABLE `selfservice_registration_requests`;
DROP TABLE `selfservice_profile_management_requests`;

View File

@@ -0,0 +1,55 @@
CREATE TABLE `selfservice_login_requests` (
`id` char(36) NOT NULL,
PRIMARY KEY(`id`),
`request_url` VARCHAR (2048) NOT NULL,
`issued_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`expires_at` DATETIME NOT NULL,
`active_method` VARCHAR (32) NOT NULL,
`csrf_token` VARCHAR (255) NOT NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL
) ENGINE=InnoDB;
CREATE TABLE `selfservice_login_request_methods` (
`id` char(36) NOT NULL,
PRIMARY KEY(`id`),
`method` VARCHAR (32) NOT NULL,
`selfservice_login_request_id` char(36) NOT NULL,
`config` JSON NOT NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL,
FOREIGN KEY (`selfservice_login_request_id`) REFERENCES `selfservice_login_requests` (`id`) ON DELETE cascade
) ENGINE=InnoDB;
CREATE TABLE `selfservice_registration_requests` (
`id` char(36) NOT NULL,
PRIMARY KEY(`id`),
`request_url` VARCHAR (2048) NOT NULL,
`issued_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`expires_at` DATETIME NOT NULL,
`active_method` VARCHAR (32) NOT NULL,
`csrf_token` VARCHAR (255) NOT NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL
) ENGINE=InnoDB;
CREATE TABLE `selfservice_registration_request_methods` (
`id` char(36) NOT NULL,
PRIMARY KEY(`id`),
`method` VARCHAR (32) NOT NULL,
`selfservice_registration_request_id` char(36) NOT NULL,
`config` JSON NOT NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL,
FOREIGN KEY (`selfservice_registration_request_id`) REFERENCES `selfservice_registration_requests` (`id`) ON DELETE cascade
) ENGINE=InnoDB;
CREATE TABLE `selfservice_profile_management_requests` (
`id` char(36) NOT NULL,
PRIMARY KEY(`id`),
`request_url` VARCHAR (2048) NOT NULL,
`issued_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`expires_at` DATETIME NOT NULL,
`form` JSON NOT NULL,
`update_successful` bool NOT NULL,
`identity_id` char(36) NOT NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL,
FOREIGN KEY (`identity_id`) REFERENCES `identities` (`id`) ON DELETE cascade
) ENGINE=InnoDB;

View File

@@ -0,0 +1,5 @@
DROP TABLE "selfservice_login_request_methods";
DROP TABLE "selfservice_login_requests";
DROP TABLE "selfservice_registration_request_methods";
DROP TABLE "selfservice_registration_requests";
DROP TABLE "selfservice_profile_management_requests";

View File

@@ -0,0 +1,55 @@
CREATE TABLE "selfservice_login_requests" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"request_url" VARCHAR (2048) NOT NULL,
"issued_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expires_at" timestamp NOT NULL,
"active_method" VARCHAR (32) NOT NULL,
"csrf_token" VARCHAR (255) NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL
);
CREATE TABLE "selfservice_login_request_methods" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"method" VARCHAR (32) NOT NULL,
"selfservice_login_request_id" UUID NOT NULL,
"config" jsonb NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL,
FOREIGN KEY ("selfservice_login_request_id") REFERENCES "selfservice_login_requests" ("id") ON DELETE cascade
);
CREATE TABLE "selfservice_registration_requests" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"request_url" VARCHAR (2048) NOT NULL,
"issued_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expires_at" timestamp NOT NULL,
"active_method" VARCHAR (32) NOT NULL,
"csrf_token" VARCHAR (255) NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL
);
CREATE TABLE "selfservice_registration_request_methods" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"method" VARCHAR (32) NOT NULL,
"selfservice_registration_request_id" UUID NOT NULL,
"config" jsonb NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL,
FOREIGN KEY ("selfservice_registration_request_id") REFERENCES "selfservice_registration_requests" ("id") ON DELETE cascade
);
CREATE TABLE "selfservice_profile_management_requests" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"request_url" VARCHAR (2048) NOT NULL,
"issued_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expires_at" timestamp NOT NULL,
"form" jsonb NOT NULL,
"update_successful" bool NOT NULL,
"identity_id" UUID NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL,
FOREIGN KEY ("identity_id") REFERENCES "identities" ("id") ON DELETE cascade
);

View File

@@ -0,0 +1,5 @@
DROP TABLE "selfservice_login_request_methods";
DROP TABLE "selfservice_login_requests";
DROP TABLE "selfservice_registration_request_methods";
DROP TABLE "selfservice_registration_requests";
DROP TABLE "selfservice_profile_management_requests";

View File

@@ -0,0 +1,50 @@
CREATE TABLE "selfservice_login_requests" (
"id" TEXT PRIMARY KEY,
"request_url" TEXT NOT NULL,
"issued_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expires_at" DATETIME NOT NULL,
"active_method" TEXT NOT NULL,
"csrf_token" TEXT NOT NULL,
"created_at" DATETIME NOT NULL,
"updated_at" DATETIME NOT NULL
);
CREATE TABLE "selfservice_login_request_methods" (
"id" TEXT PRIMARY KEY,
"method" TEXT NOT NULL,
"selfservice_login_request_id" char(36) NOT NULL,
"config" TEXT NOT NULL,
"created_at" DATETIME NOT NULL,
"updated_at" DATETIME NOT NULL,
FOREIGN KEY (selfservice_login_request_id) REFERENCES selfservice_login_requests (id) ON DELETE cascade
);
CREATE TABLE "selfservice_registration_requests" (
"id" TEXT PRIMARY KEY,
"request_url" TEXT NOT NULL,
"issued_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expires_at" DATETIME NOT NULL,
"active_method" TEXT NOT NULL,
"csrf_token" TEXT NOT NULL,
"created_at" DATETIME NOT NULL,
"updated_at" DATETIME NOT NULL
);
CREATE TABLE "selfservice_registration_request_methods" (
"id" TEXT PRIMARY KEY,
"method" TEXT NOT NULL,
"selfservice_registration_request_id" char(36) NOT NULL,
"config" TEXT NOT NULL,
"created_at" DATETIME NOT NULL,
"updated_at" DATETIME NOT NULL,
FOREIGN KEY (selfservice_registration_request_id) REFERENCES selfservice_registration_requests (id) ON DELETE cascade
);
CREATE TABLE "selfservice_profile_management_requests" (
"id" TEXT PRIMARY KEY,
"request_url" TEXT NOT NULL,
"issued_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expires_at" DATETIME NOT NULL,
"form" TEXT NOT NULL,
"update_successful" bool NOT NULL,
"identity_id" char(36) NOT NULL,
"created_at" DATETIME NOT NULL,
"updated_at" DATETIME NOT NULL,
FOREIGN KEY (identity_id) REFERENCES identities (id) ON DELETE cascade
);

View File

@@ -0,0 +1 @@
DROP TABLE "sessions";COMMIT TRANSACTION;BEGIN TRANSACTION;

View File

@@ -0,0 +1,11 @@
CREATE TABLE "sessions" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"issued_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expires_at" timestamp NOT NULL,
"authenticated_at" timestamp NOT NULL,
"identity_id" UUID NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL,
CONSTRAINT "sessions_identities_id_fk" FOREIGN KEY ("identity_id") REFERENCES "identities" ("id") ON DELETE cascade
);COMMIT TRANSACTION;BEGIN TRANSACTION;

View File

@@ -0,0 +1 @@
DROP TABLE `sessions`;

View File

@@ -0,0 +1,11 @@
CREATE TABLE `sessions` (
`id` char(36) NOT NULL,
PRIMARY KEY(`id`),
`issued_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`expires_at` DATETIME NOT NULL,
`authenticated_at` DATETIME NOT NULL,
`identity_id` char(36) NOT NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL,
FOREIGN KEY (`identity_id`) REFERENCES `identities` (`id`) ON DELETE cascade
) ENGINE=InnoDB;

View File

@@ -0,0 +1 @@
DROP TABLE "sessions";

View File

@@ -0,0 +1,11 @@
CREATE TABLE "sessions" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"issued_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expires_at" timestamp NOT NULL,
"authenticated_at" timestamp NOT NULL,
"identity_id" UUID NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL,
FOREIGN KEY ("identity_id") REFERENCES "identities" ("id") ON DELETE cascade
);

View File

@@ -0,0 +1 @@
DROP TABLE "sessions";

View File

@@ -0,0 +1,10 @@
CREATE TABLE "sessions" (
"id" TEXT PRIMARY KEY,
"issued_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expires_at" DATETIME NOT NULL,
"authenticated_at" DATETIME NOT NULL,
"identity_id" char(36) NOT NULL,
"created_at" DATETIME NOT NULL,
"updated_at" DATETIME NOT NULL,
FOREIGN KEY (identity_id) REFERENCES identities (id) ON DELETE cascade
);

View File

@@ -0,0 +1 @@
DROP TABLE "selfservice_errors";COMMIT TRANSACTION;BEGIN TRANSACTION;

View File

@@ -0,0 +1,9 @@
CREATE TABLE "selfservice_errors" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"errors" json NOT NULL,
"seen_at" timestamp NOT NULL,
"was_seen" bool NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL
);COMMIT TRANSACTION;BEGIN TRANSACTION;

View File

@@ -0,0 +1 @@
DROP TABLE `selfservice_errors`;

View File

@@ -0,0 +1,9 @@
CREATE TABLE `selfservice_errors` (
`id` char(36) NOT NULL,
PRIMARY KEY(`id`),
`errors` JSON NOT NULL,
`seen_at` DATETIME NOT NULL,
`was_seen` bool NOT NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL
) ENGINE=InnoDB;

View File

@@ -0,0 +1 @@
DROP TABLE "selfservice_errors";

View File

@@ -0,0 +1,9 @@
CREATE TABLE "selfservice_errors" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"errors" jsonb NOT NULL,
"seen_at" timestamp NOT NULL,
"was_seen" bool NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL
);

View File

@@ -0,0 +1 @@
DROP TABLE "selfservice_errors";

View File

@@ -0,0 +1,8 @@
CREATE TABLE "selfservice_errors" (
"id" TEXT PRIMARY KEY,
"errors" TEXT NOT NULL,
"seen_at" DATETIME NOT NULL,
"was_seen" bool NOT NULL,
"created_at" DATETIME NOT NULL,
"updated_at" DATETIME NOT NULL
);

View File

@@ -0,0 +1 @@
ALTER TABLE identity_credential_identifiers MODIFY COLUMN identifier VARCHAR(255);

View File

@@ -0,0 +1 @@
ALTER TABLE identity_credential_identifiers MODIFY COLUMN identifier VARCHAR(255) BINARY;

View File

@@ -0,0 +1 @@
DROP TABLE "courier_messages";COMMIT TRANSACTION;BEGIN TRANSACTION;

View File

@@ -0,0 +1,11 @@
CREATE TABLE "courier_messages" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"type" int NOT NULL,
"status" int NOT NULL,
"body" VARCHAR (255) NOT NULL,
"subject" VARCHAR (255) NOT NULL,
"recipient" VARCHAR (255) NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL
);COMMIT TRANSACTION;BEGIN TRANSACTION;

View File

@@ -0,0 +1 @@
DROP TABLE `courier_messages`;

View File

@@ -0,0 +1,11 @@
CREATE TABLE `courier_messages` (
`id` char(36) NOT NULL,
PRIMARY KEY(`id`),
`type` INTEGER NOT NULL,
`status` INTEGER NOT NULL,
`body` VARCHAR (255) NOT NULL,
`subject` VARCHAR (255) NOT NULL,
`recipient` VARCHAR (255) NOT NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL
) ENGINE=InnoDB;

View File

@@ -0,0 +1 @@
DROP TABLE "courier_messages";

View File

@@ -0,0 +1,11 @@
CREATE TABLE "courier_messages" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"type" int NOT NULL,
"status" int NOT NULL,
"body" VARCHAR (255) NOT NULL,
"subject" VARCHAR (255) NOT NULL,
"recipient" VARCHAR (255) NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL
);

View File

@@ -0,0 +1 @@
DROP TABLE "courier_messages";

View File

@@ -0,0 +1,10 @@
CREATE TABLE "courier_messages" (
"id" TEXT PRIMARY KEY,
"type" INTEGER NOT NULL,
"status" INTEGER NOT NULL,
"body" TEXT NOT NULL,
"subject" TEXT NOT NULL,
"recipient" TEXT NOT NULL,
"created_at" DATETIME NOT NULL,
"updated_at" DATETIME NOT NULL
);

View File

@@ -0,0 +1 @@
ALTER TABLE "selfservice_errors" DROP COLUMN "csrf_token";COMMIT TRANSACTION;BEGIN TRANSACTION;

View File

@@ -0,0 +1 @@
ALTER TABLE "selfservice_errors" ADD COLUMN "csrf_token" VARCHAR (255) NOT NULL DEFAULT '';COMMIT TRANSACTION;BEGIN TRANSACTION;

View File

@@ -0,0 +1 @@
ALTER TABLE `selfservice_errors` DROP COLUMN `csrf_token`;

View File

@@ -0,0 +1 @@
ALTER TABLE `selfservice_errors` ADD COLUMN `csrf_token` VARCHAR (255) NOT NULL DEFAULT "";

View File

@@ -0,0 +1 @@
ALTER TABLE "selfservice_errors" DROP COLUMN "csrf_token";

View File

@@ -0,0 +1 @@
ALTER TABLE "selfservice_errors" ADD COLUMN "csrf_token" VARCHAR (255) NOT NULL DEFAULT '';

View File

@@ -0,0 +1,12 @@
CREATE TABLE "_selfservice_errors_tmp" (
"id" TEXT PRIMARY KEY,
"errors" TEXT NOT NULL,
"seen_at" DATETIME,
"was_seen" bool NOT NULL,
"created_at" DATETIME NOT NULL,
"updated_at" DATETIME NOT NULL
);
INSERT INTO "_selfservice_errors_tmp" (id, errors, seen_at, was_seen, created_at, updated_at) SELECT id, errors, seen_at, was_seen, created_at, updated_at FROM "selfservice_errors";
DROP TABLE "selfservice_errors";
ALTER TABLE "_selfservice_errors_tmp" RENAME TO "selfservice_errors";

View File

@@ -0,0 +1 @@
ALTER TABLE "selfservice_errors" ADD COLUMN "csrf_token" TEXT NOT NULL DEFAULT '';

View File

@@ -0,0 +1,2 @@
DROP TABLE "selfservice_verification_requests";COMMIT TRANSACTION;BEGIN TRANSACTION;
DROP TABLE "identity_verifiable_addresses";COMMIT TRANSACTION;BEGIN TRANSACTION;

View File

@@ -0,0 +1,32 @@
CREATE TABLE "identity_verifiable_addresses" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"code" VARCHAR (32) NOT NULL,
"status" VARCHAR (16) NOT NULL,
"via" VARCHAR (16) NOT NULL,
"verified" bool NOT NULL,
"value" VARCHAR (400) NOT NULL,
"verified_at" timestamp,
"expires_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"identity_id" UUID NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL,
CONSTRAINT "identity_verifiable_addresses_identities_id_fk" FOREIGN KEY ("identity_id") REFERENCES "identities" ("id") ON DELETE cascade
);COMMIT TRANSACTION;BEGIN TRANSACTION;
CREATE UNIQUE INDEX "identity_verifiable_addresses_code_uq_idx" ON "identity_verifiable_addresses" (code);COMMIT TRANSACTION;BEGIN TRANSACTION;
CREATE INDEX "identity_verifiable_addresses_code_idx" ON "identity_verifiable_addresses" (code);COMMIT TRANSACTION;BEGIN TRANSACTION;
CREATE UNIQUE INDEX "identity_verifiable_addresses_status_via_uq_idx" ON "identity_verifiable_addresses" (via, value);COMMIT TRANSACTION;BEGIN TRANSACTION;
CREATE INDEX "identity_verifiable_addresses_status_via_idx" ON "identity_verifiable_addresses" (via, value);COMMIT TRANSACTION;BEGIN TRANSACTION;
CREATE TABLE "selfservice_verification_requests" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"request_url" VARCHAR (2048) NOT NULL,
"issued_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expires_at" timestamp NOT NULL,
"form" json NOT NULL,
"via" VARCHAR (16) NOT NULL,
"csrf_token" VARCHAR (255) NOT NULL,
"success" bool NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL
);COMMIT TRANSACTION;BEGIN TRANSACTION;

View File

@@ -0,0 +1,2 @@
DROP TABLE `selfservice_verification_requests`;
DROP TABLE `identity_verifiable_addresses`;

View File

@@ -0,0 +1,32 @@
CREATE TABLE `identity_verifiable_addresses` (
`id` char(36) NOT NULL,
PRIMARY KEY(`id`),
`code` VARCHAR (32) NOT NULL,
`status` VARCHAR (16) NOT NULL,
`via` VARCHAR (16) NOT NULL,
`verified` bool NOT NULL,
`value` VARCHAR (400) NOT NULL,
`verified_at` DATETIME,
`expires_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`identity_id` char(36) NOT NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL,
FOREIGN KEY (`identity_id`) REFERENCES `identities` (`id`) ON DELETE cascade
) ENGINE=InnoDB;
CREATE UNIQUE INDEX `identity_verifiable_addresses_code_uq_idx` ON `identity_verifiable_addresses` (`code`);
CREATE INDEX `identity_verifiable_addresses_code_idx` ON `identity_verifiable_addresses` (`code`);
CREATE UNIQUE INDEX `identity_verifiable_addresses_status_via_uq_idx` ON `identity_verifiable_addresses` (`via`, `value`);
CREATE INDEX `identity_verifiable_addresses_status_via_idx` ON `identity_verifiable_addresses` (`via`, `value`);
CREATE TABLE `selfservice_verification_requests` (
`id` char(36) NOT NULL,
PRIMARY KEY(`id`),
`request_url` VARCHAR (2048) NOT NULL,
`issued_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`expires_at` DATETIME NOT NULL,
`form` JSON NOT NULL,
`via` VARCHAR (16) NOT NULL,
`csrf_token` VARCHAR (255) NOT NULL,
`success` bool NOT NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL
) ENGINE=InnoDB;

View File

@@ -0,0 +1,2 @@
DROP TABLE "selfservice_verification_requests";
DROP TABLE "identity_verifiable_addresses";

View File

@@ -0,0 +1,32 @@
CREATE TABLE "identity_verifiable_addresses" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"code" VARCHAR (32) NOT NULL,
"status" VARCHAR (16) NOT NULL,
"via" VARCHAR (16) NOT NULL,
"verified" bool NOT NULL,
"value" VARCHAR (400) NOT NULL,
"verified_at" timestamp,
"expires_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"identity_id" UUID NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL,
FOREIGN KEY ("identity_id") REFERENCES "identities" ("id") ON DELETE cascade
);
CREATE UNIQUE INDEX "identity_verifiable_addresses_code_uq_idx" ON "identity_verifiable_addresses" (code);
CREATE INDEX "identity_verifiable_addresses_code_idx" ON "identity_verifiable_addresses" (code);
CREATE UNIQUE INDEX "identity_verifiable_addresses_status_via_uq_idx" ON "identity_verifiable_addresses" (via, value);
CREATE INDEX "identity_verifiable_addresses_status_via_idx" ON "identity_verifiable_addresses" (via, value);
CREATE TABLE "selfservice_verification_requests" (
"id" UUID NOT NULL,
PRIMARY KEY("id"),
"request_url" VARCHAR (2048) NOT NULL,
"issued_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expires_at" timestamp NOT NULL,
"form" jsonb NOT NULL,
"via" VARCHAR (16) NOT NULL,
"csrf_token" VARCHAR (255) NOT NULL,
"success" bool NOT NULL,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL
);

View File

@@ -0,0 +1,2 @@
DROP TABLE "selfservice_verification_requests";
DROP TABLE "identity_verifiable_addresses";

View File

@@ -0,0 +1,30 @@
CREATE TABLE "identity_verifiable_addresses" (
"id" TEXT PRIMARY KEY,
"code" TEXT NOT NULL,
"status" TEXT NOT NULL,
"via" TEXT NOT NULL,
"verified" bool NOT NULL,
"value" TEXT NOT NULL,
"verified_at" DATETIME,
"expires_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"identity_id" char(36) NOT NULL,
"created_at" DATETIME NOT NULL,
"updated_at" DATETIME NOT NULL,
FOREIGN KEY (identity_id) REFERENCES identities (id) ON DELETE cascade
);
CREATE UNIQUE INDEX "identity_verifiable_addresses_code_uq_idx" ON "identity_verifiable_addresses" (code);
CREATE INDEX "identity_verifiable_addresses_code_idx" ON "identity_verifiable_addresses" (code);
CREATE UNIQUE INDEX "identity_verifiable_addresses_status_via_uq_idx" ON "identity_verifiable_addresses" (via, value);
CREATE INDEX "identity_verifiable_addresses_status_via_idx" ON "identity_verifiable_addresses" (via, value);
CREATE TABLE "selfservice_verification_requests" (
"id" TEXT PRIMARY KEY,
"request_url" TEXT NOT NULL,
"issued_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expires_at" DATETIME NOT NULL,
"form" TEXT NOT NULL,
"via" TEXT NOT NULL,
"csrf_token" TEXT NOT NULL,
"success" bool NOT NULL,
"created_at" DATETIME NOT NULL,
"updated_at" DATETIME NOT NULL
);

View File

@@ -0,0 +1 @@
ALTER TABLE identity_verifiable_addresses MODIFY COLUMN code VARCHAR(255);

View File

@@ -0,0 +1 @@
ALTER TABLE identity_verifiable_addresses MODIFY COLUMN code VARCHAR(255) BINARY;

View File

@@ -0,0 +1,5 @@
UPDATE selfservice_errors SET seen_at = '1980-01-01 00:00:00' WHERE seen_at = NULL;
ALTER TABLE "selfservice_errors" RENAME COLUMN "seen_at" TO "_seen_at_tmp";COMMIT TRANSACTION;BEGIN TRANSACTION;
ALTER TABLE "selfservice_errors" ADD COLUMN "seen_at" timestamp;COMMIT TRANSACTION;BEGIN TRANSACTION;
UPDATE "selfservice_errors" SET "seen_at" = "_seen_at_tmp";COMMIT TRANSACTION;BEGIN TRANSACTION;
ALTER TABLE "selfservice_errors" DROP COLUMN "_seen_at_tmp";COMMIT TRANSACTION;BEGIN TRANSACTION;

View File

@@ -0,0 +1,4 @@
ALTER TABLE "selfservice_errors" RENAME COLUMN "seen_at" TO "_seen_at_tmp";COMMIT TRANSACTION;BEGIN TRANSACTION;
ALTER TABLE "selfservice_errors" ADD COLUMN "seen_at" timestamp;COMMIT TRANSACTION;BEGIN TRANSACTION;
UPDATE "selfservice_errors" SET "seen_at" = "_seen_at_tmp";COMMIT TRANSACTION;BEGIN TRANSACTION;
ALTER TABLE "selfservice_errors" DROP COLUMN "_seen_at_tmp";COMMIT TRANSACTION;BEGIN TRANSACTION;

View File

@@ -0,0 +1,2 @@
UPDATE selfservice_errors SET seen_at = '1980-01-01 00:00:00' WHERE seen_at = NULL;
ALTER TABLE `selfservice_errors` MODIFY `seen_at` DATETIME;

View File

@@ -0,0 +1 @@
ALTER TABLE `selfservice_errors` MODIFY `seen_at` DATETIME;

View File

@@ -0,0 +1,2 @@
UPDATE selfservice_errors SET seen_at = '1980-01-01 00:00:00' WHERE seen_at = NULL;
ALTER TABLE "selfservice_errors" ALTER COLUMN "seen_at" TYPE timestamp, ALTER COLUMN "seen_at" DROP NOT NULL;

View File

@@ -0,0 +1 @@
ALTER TABLE "selfservice_errors" ALTER COLUMN "seen_at" TYPE timestamp, ALTER COLUMN "seen_at" DROP NOT NULL;

View File

@@ -0,0 +1,13 @@
UPDATE selfservice_errors SET seen_at = '1980-01-01 00:00:00' WHERE seen_at = NULL;
CREATE TABLE "_selfservice_errors_tmp" (
"id" TEXT PRIMARY KEY,
"errors" TEXT NOT NULL,
"seen_at" DATETIME,
"was_seen" bool NOT NULL,
"created_at" DATETIME NOT NULL,
"updated_at" DATETIME NOT NULL,
"csrf_token" TEXT NOT NULL DEFAULT ''
);
INSERT INTO "_selfservice_errors_tmp" (id, errors, seen_at, was_seen, created_at, updated_at, csrf_token) SELECT id, errors, seen_at, was_seen, created_at, updated_at, csrf_token FROM "selfservice_errors";
DROP TABLE "selfservice_errors";
ALTER TABLE "_selfservice_errors_tmp" RENAME TO "selfservice_errors";

View File

@@ -0,0 +1,12 @@
CREATE TABLE "_selfservice_errors_tmp" (
"id" TEXT PRIMARY KEY,
"errors" TEXT NOT NULL,
"seen_at" DATETIME,
"was_seen" bool NOT NULL,
"created_at" DATETIME NOT NULL,
"updated_at" DATETIME NOT NULL,
"csrf_token" TEXT NOT NULL DEFAULT ''
);
INSERT INTO "_selfservice_errors_tmp" (id, errors, seen_at, was_seen, created_at, updated_at, csrf_token) SELECT id, errors, seen_at, was_seen, created_at, updated_at, csrf_token FROM "selfservice_errors";
DROP TABLE "selfservice_errors";
ALTER TABLE "_selfservice_errors_tmp" RENAME TO "selfservice_errors";

View File

@@ -0,0 +1,5 @@
ALTER TABLE "courier_messages" RENAME COLUMN "body" TO "_body_tmp";COMMIT TRANSACTION;BEGIN TRANSACTION;
ALTER TABLE "courier_messages" ADD COLUMN "body" text;COMMIT TRANSACTION;BEGIN TRANSACTION;
UPDATE "courier_messages" SET "body" = "_body_tmp";COMMIT TRANSACTION;BEGIN TRANSACTION;
ALTER TABLE "courier_messages" ALTER COLUMN "body" SET NOT NULL;COMMIT TRANSACTION;BEGIN TRANSACTION;
ALTER TABLE "courier_messages" DROP COLUMN "_body_tmp";COMMIT TRANSACTION;BEGIN TRANSACTION;

View File

@@ -0,0 +1 @@
ALTER TABLE `courier_messages` MODIFY `body` text NOT NULL;

View File

@@ -0,0 +1 @@
ALTER TABLE "courier_messages" ALTER COLUMN "body" TYPE text, ALTER COLUMN "body" SET NOT NULL;

View File

@@ -0,0 +1,13 @@
CREATE TABLE "_courier_messages_tmp" (
"id" TEXT PRIMARY KEY,
"type" INTEGER NOT NULL,
"status" INTEGER NOT NULL,
"body" TEXT NOT NULL,
"subject" TEXT NOT NULL,
"recipient" TEXT NOT NULL,
"created_at" DATETIME NOT NULL,
"updated_at" DATETIME NOT NULL
);
INSERT INTO "_courier_messages_tmp" (id, type, status, body, subject, recipient, created_at, updated_at) SELECT id, type, status, body, subject, recipient, created_at, updated_at FROM "courier_messages";
DROP TABLE "courier_messages";
ALTER TABLE "_courier_messages_tmp" RENAME TO "courier_messages";

View File

@@ -0,0 +1 @@
ALTER TABLE "selfservice_login_requests" DROP COLUMN "forced";COMMIT TRANSACTION;BEGIN TRANSACTION;

Some files were not shown because too many files have changed in this diff Show More