Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/activerecord-clean-db-structure/clean_dump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def clean
dump.gsub!(/^SET default_with_oids = false;\n/m, '') # all older than 12
dump.gsub!(/^SET xmloption = content;\n/m, '') # 12
dump.gsub!(/^SET default_table_access_method = heap;\n/m, '') # 12
dump.gsub!(/^\\(un)?restrict [A-Za-z0-9]+\n\n?/m, '') # 17.6

extensions_to_remove = ["pg_stat_statements", "pg_buffercache"]
if options[:keep_extensions] == :all
Expand Down
4 changes: 4 additions & 0 deletions test/data/input.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
\restrict eVA4gCZvdSnhJn7MKha0lZbmA4

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
Expand Down Expand Up @@ -149,6 +151,8 @@ CREATE INDEX index_delayed_jobs_on_run_at ON public.delayed_jobs USING btree (ru

SET search_path TO "$user", public;

\unrestrict eVA4gCZvdSnhJn7MKha0lZbmA4

INSERT INTO "schema_migrations" (version) VALUES
('20240822225012'),
('20240822224954'),
Expand Down