Hi, I have migration file but failed to run and got:
pq: unterminated dollar-quoted string at or near "$$
BEGIN
if not exists (SELECT safe_url_name, COUNT(*) FROM people_model.agents GROUP BY safe_url_name HAVING COUNT(*) > 1) x then
Here is my migrate up .sql:
-- +migrate Up
SET LOCAL statement_timeout = '15s';
DO $$
BEGIN
if not exists (SELECT safe_url_name, COUNT(*) FROM people_model.agents GROUP BY safe_url_name HAVING COUNT(*) > 1) x then
ALTER TABLE people_model.agents ADD CONSTRAINT "agents_safe_url_name_key5" UNIQUE ("safe_url_name");
else
RAISE NOTICE 'safe_url_name has duplicates';
end if;
END $$;
Someone faced the same issue before, but I can not figure it out. Can someone give me some guidance?
Hi, I have migration file but failed to run and got:
Here is my migrate up .sql:
Someone faced the same issue before, but I can not figure it out. Can someone give me some guidance?