Archon icon indicating copy to clipboard operation
Archon copied to clipboard

Improve complete_setup.sql script.

Open kaywessel opened this issue 3 months ago • 1 comments

In order for the script not to crash if the trigger update_archon_settings_updated_at already exists this check could be added:

DO $$ BEGIN IF NOT EXISTS ( SELECT 1 FROM pg_trigger WHERE tgname = 'update_archon_settings_updated_at' ) THEN CREATE TRIGGER update_archon_settings_updated_at BEFORE UPDATE ON archon_settings FOR EACH ROW EXECUTE FUNCTION update_updated_at_column(); END IF; END$$;

Instead of just:

CREATE TRIGGER update_archon_settings_updated_at BEFORE UPDATE ON archon_settings FOR EACH ROW EXECUTE FUNCTION update_updated_at_column(); END IF;

Which will cause an error.

kaywessel avatar Oct 12 '25 19:10 kaywessel

This is probably a part duplicate of #738

kaywessel avatar Oct 14 '25 10:10 kaywessel