ALTER TABLE IDN_OAUTH2_TOKEN_BINDING ADD CONSTRAINT TOKEN_ID_TOKEN_BINDING_TYPE_TOKEN_BINDING_VALUE__KEY UNIQUE(TOKEN_ID,TOKEN_BINDING_TYPE,TOKEN_BINDING_VALUE);
DO $$ DECLARE con_name varchar(200); BEGIN SELECT 'ALTER TABLE idn_oauth2_token_binding DROP CONSTRAINT ' || tc .constraint_name || ';' INTO con_name FROM information_schema.table_constraints AS tc JOIN information_schema.key_column_usage AS kcu ON tc.constraint_name = kcu.constraint_name JOIN information_schema.constraint_column_usage AS ccu ON ccu.constraint_name = tc.constraint_name WHERE constraint_type = 'PRIMARY KEY' AND tc.table_name = 'idn_oauth2_token_binding'; EXECUTE con_name; END $$;
