Skip to content
Closed
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
6 changes: 6 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ class Application < Rails::Application
# Turbo only renders form replies that are redirects or 4xx/5xx errors
config.responders.error_status = :unprocessable_content
config.responders.redirect_status = :see_other

# The database has things schema.rb can't describe (extensions, the topology schema, and functions
# such as nanoid() used in column defaults), so it is dumped as SQL to db/structure.sql. Every schema
# is dumped, not only those on the search path, so the extensions' own schemas come along.
config.active_record.schema_format = :sql
config.active_record.dump_schemas = 'public'
end
end

Expand Down
5 changes: 5 additions & 0 deletions config/initializers/structure_dump.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

# db/structure.sql leaves out who owns each object and who may use it: those are roles on the machine it
# was dumped from, and loading it elsewhere (a test database, a new machine) would fail on them.
ActiveRecord::Tasks::DatabaseTasks.structure_dump_flags = %w[--no-owner --no-privileges]
Loading
Loading