Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgreSQL booleans not supported #75

Open
burnt43 opened this issue Feb 27, 2017 · 1 comment
Open

PostgreSQL booleans not supported #75

burnt43 opened this issue Feb 27, 2017 · 1 comment

Comments

@burnt43
Copy link
Contributor

burnt43 commented Feb 27, 2017

In auto_upgrade! if you choose a field with type :boolean it will call
connection.add_column table_name, column.name, column.type.to_sym, options

However, options will include :limit => 1 and in turn it will cause a query to PostgreSQL looking like
SELECT 'boolean(1)'::regtype::oid instead of the correct SELECT 'boolean'::regtype::oid.

I have a fix for this, but I am also working out some other issues with PostgreSQL and mini_record.

@burnt43
Copy link
Contributor Author

burnt43 commented Feb 27, 2017

Basically to fix it you can add options[:limit] = nil if column.type.to_sym == :boolean && defined?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter) && connection.is_a?(ActiveRecord::ConnectionAdapters::P ostgreSQLAdapter)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant