ocket8888 commented on code in PR #6802: URL: https://github.com/apache/trafficcontrol/pull/6802#discussion_r878647473
########## traffic_ops/app/db/create_tables.sql: ########## @@ -37,6 +37,30 @@ CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; SET search_path = public, pg_catalog; +-- +-- Name: fast_forward_schema_migrations_version(); Type: FUNCTION; Schema: public; Owner: traffic_ops +-- + +CREATE OR REPLACE FUNCTION fast_forward_schema_migrations_version() + RETURNS TRIGGER + LANGUAGE PLPGSQL +AS $$ +BEGIN + IF EXISTS (SELECT FROM information_schema.columns WHERE table_name = 'goose_db_version') THEN + UPDATE schema_migrations SET "version" = (SELECT version_id FROM goose_db_version + ORDER BY TSTAMP DESC + LIMIT 1); + ALTER TABLE goose_db_version + RENAME TO goose_db_version_unused; + END IF; + DROP TRIGGER fast_forward_schema_migrations_trigger ON schema_migrations; + DROP FUNCTION fast_forward_schema_migrations_version(); + RETURN NULL; +END$$; + +ALTER FUNCTION public.fast_forward_schema_migrations_version OWNER TO traffic_ops; Review Comment: That's probably why the database tests fail -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
