-
-
Notifications
You must be signed in to change notification settings - Fork 16
Description
When using torque-postgresql with Rails 8.0.2 and Ruby 3.4.5, rake db:schema:dump does not work correctly. It fails for table ('products') that include Postgres-specific types or triggers. As a result, none of the triggers defined in the project appear in the generated schema.rb.
Instead of dumping the schema, I get:
# Could not dump table "public.products" because of following NoMethodError
# undefined method `scan` for nil:NilClassWithout the gem, the schema dump works as expected: the table is included and all triggers are present.
-
Rails app with:
- Ruby 3.4.5
- Rails 8.0.2
- Postgres 14.18
gem 'torque-postgresql', '~> 4.0'
-
Add a table that contains:
jsonbcolumns with default'{}'::jsonb- array columns (
character varying[],integer[]) with default'{}'::...[] - a
tsvectorcolumn - triggers on the table
-
Run:
rails db:migrate rails db:schema:dump
Removing the gem makes the schema dump succeed (table + triggers appear).
I think using config.active_record.schema_format = :sql is a workaround, but I would prefer to keep schema.rb.
Any help or guidance on fixing this issue in Rails 8 would be greatly appreciated.
Thanks in advance for your support and for maintaining this gem!