persistence/sql/migrations/20220513000001000008_string_slice_json.postgres.up.sql
-- Migration generated by the command below; DO NOT EDIT.
-- hydra:generate hydra migrate gen
ALTER TABLE hydra_oauth2_flow ALTER COLUMN requested_scope_json DROP DEFAULT;
ALTER TABLE hydra_oauth2_flow DROP COLUMN requested_scope;
ALTER TABLE hydra_oauth2_flow DROP COLUMN requested_at_audience;
ALTER TABLE hydra_oauth2_flow DROP COLUMN amr;
ALTER TABLE hydra_oauth2_flow DROP COLUMN granted_scope;
ALTER TABLE hydra_oauth2_flow DROP COLUMN granted_at_audience;
ALTER TABLE hydra_oauth2_flow RENAME COLUMN requested_scope_json TO requested_scope;
ALTER TABLE hydra_oauth2_flow RENAME COLUMN requested_at_audience_json TO requested_at_audience;
ALTER TABLE hydra_oauth2_flow RENAME COLUMN amr_json TO amr;
ALTER TABLE hydra_oauth2_flow RENAME COLUMN granted_scope_json TO granted_scope;
ALTER TABLE hydra_oauth2_flow RENAME COLUMN granted_at_audience_json TO granted_at_audience;
-- scripts/db-diff.sh can be used in code review to verify that the constraint hasn't changed; we need to recreate it due to the dropped and re-added columns
ALTER TABLE hydra_oauth2_flow ADD CHECK (
state = 128 OR
state = 129 OR
state = 1 OR
(state = 2 AND (
login_remember IS NOT NULL AND
login_remember_for IS NOT NULL AND
login_error IS NOT NULL AND
acr IS NOT NULL AND
login_was_used IS NOT NULL AND
context IS NOT NULL AND
amr IS NOT NULL
)) OR
(state = 3 AND (
login_remember IS NOT NULL AND
login_remember_for IS NOT NULL AND
login_error IS NOT NULL AND
acr IS NOT NULL AND
login_was_used IS NOT NULL AND
context IS NOT NULL AND
amr IS NOT NULL
)) OR
(state = 4 AND (
login_remember IS NOT NULL AND
login_remember_for IS NOT NULL AND
login_error IS NOT NULL AND
acr IS NOT NULL AND
login_was_used IS NOT NULL AND
context IS NOT NULL AND
amr IS NOT NULL AND
consent_challenge_id IS NOT NULL AND
consent_verifier IS NOT NULL AND
consent_skip IS NOT NULL AND
consent_csrf IS NOT NULL
)) OR
(state = 5 AND (
login_remember IS NOT NULL AND
login_remember_for IS NOT NULL AND
login_error IS NOT NULL AND
acr IS NOT NULL AND
login_was_used IS NOT NULL AND
context IS NOT NULL AND
amr IS NOT NULL AND
consent_challenge_id IS NOT NULL AND
consent_verifier IS NOT NULL AND
consent_skip IS NOT NULL AND
consent_csrf IS NOT NULL
)) OR
(state = 6 AND (
login_remember IS NOT NULL AND
login_remember_for IS NOT NULL AND
login_error IS NOT NULL AND
acr IS NOT NULL AND
login_was_used IS NOT NULL AND
context IS NOT NULL AND
amr IS NOT NULL AND
consent_challenge_id IS NOT NULL AND
consent_verifier IS NOT NULL AND
consent_skip IS NOT NULL AND
consent_csrf IS NOT NULL AND
granted_scope IS NOT NULL AND
consent_remember IS NOT NULL AND
consent_remember_for IS NOT NULL AND
consent_error IS NOT NULL AND
session_access_token IS NOT NULL AND
session_id_token IS NOT NULL AND
consent_was_used IS NOT NULL
))
)