Sha256: 69c48f902abbe8c5eec9f2bd752c4015f456316142938f4d1029492b9d176ffc
Contents?: true
Size: 871 Bytes
Versions: 13
Compression:
Stored size: 871 Bytes
Contents
class AddApacheAge < ActiveRecord::Migration[7.1] def up # Allow age extension execute('CREATE EXTENSION IF NOT EXISTS age;') # Load the age code execute("LOAD 'age';") # Load the ag_catalog into the search path execute('SET search_path = ag_catalog, "$user", public;') # Create age_schema graph if it doesn't exist execute("SELECT create_graph('age_schema');") end def down execute <<-SQL DO $$ BEGIN IF EXISTS ( SELECT 1 FROM pg_constraint WHERE conname = 'fk_graph_oid' ) THEN ALTER TABLE ag_catalog.ag_label DROP CONSTRAINT fk_graph_oid; END IF; END $$; SQL execute("SELECT drop_graph('age_schema', true);") execute('DROP SCHEMA IF EXISTS ag_catalog CASCADE;') execute('DROP EXTENSION IF EXISTS age;') end end
Version data entries
13 entries across 13 versions & 1 rubygems