lib/pgslice/cli/swap.rb in pgslice-0.4.6 vs lib/pgslice/cli/swap.rb in pgslice-0.4.7
- old
+ new
@@ -15,10 +15,10 @@
"ALTER TABLE #{quote_table(table)} RENAME TO #{quote_no_schema(retired_table)};",
"ALTER TABLE #{quote_table(intermediate_table)} RENAME TO #{quote_no_schema(table)};"
]
table.sequences.each do |sequence|
- queries << "ALTER SEQUENCE #{quote_ident(sequence["sequence_name"])} OWNED BY #{quote_table(table)}.#{quote_ident(sequence["related_column"])};"
+ queries << "ALTER SEQUENCE #{quote_ident(sequence["sequence_schema"])}.#{quote_ident(sequence["sequence_name"])} OWNED BY #{quote_table(table)}.#{quote_ident(sequence["related_column"])};"
end
queries.unshift("SET LOCAL lock_timeout = '#{options[:lock_timeout]}';") if server_version_num >= 90300
run_queries(queries)