activerecord-cockroachdb-adapter
activerecord-cockroachdb-adapter copied to clipboard
crdb_region and the database name shows up in the schema file
When using regional by row tables, crdb_region shows up in the schema file and it also has the development database name in the primary region definition. For example:
t.enum "crdb_region", default: -> { "default_to_database_primary_region(gateway_region())::app1_development.public.crdb_internal_region" }, null: false, enum_type: "crdb_internal_region", hidden: true
As a workaround, we have to patch column_definitions method in the adapter to hide the crdb_region definition completely.
def column_definitions(table_name)
fields = super
fields.reject { |field| field.first == "crdb_region" }
end
Is there a reason behind dumping hidden crdb_region column in the schema with a hardcoded database name?
P.S. Adapter version 7.2 with Rails 7.2.
I think we should close this in favor of #344 and #338. Have you had a chance to see if these issues are related to yours ? And isn't the PR #345 fixing it ?