abrandoned / activerecord-jdbcvertica-adapter

MIT License
3 stars 5 forks source link

Mds/bigint update #10

Closed mrdeadsake closed 5 years ago

mrdeadsake commented 5 years ago

When running a rails migration that adds a column of type :integer, limit: 8 vertica tries to parse out the limit and breaks with an error of

ActiveRecord::StatementInvalid: ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: [Vertica]VJDBC ERROR: Syntax error at or near "(": CREATE TABLE beats (id INTEGER NOT NULL PRIMARY KEY, guid varchar(40), external_guid varchar(255), source integer, user_id integer, associated_account_id integer, associated_transaction_id integer(8), description varchar(255), has_been_displayed boolean, has_been_viewed boolean, rating integer, template varchar(255), title varchar(255), displayed_at datetime, viewed_at datetime, created_at datetime, updated_at datetime, record_created_at datetime, record_deleted_at datetime, record_updated_at datetime) [] arjdbc/jdbc/RubyJdbcConnection.java:587:in execute

this code overrides the method here:
https://github.com/rails/rails/blob/v4.2.7.1/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb#L865

only when the type is integer. Vertica actually only supports 8-bit integers so it doesn't need to specify this. However postgresql needs the limit=> 8 in order to accommodate the larger int size.

https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/SQLReferenceManual/DataTypes/Numeric/INTEGER.htm

ppkn commented 5 years ago

@film42 What can I do to get this across the finish line? Does it require CI with a Vertica VM?

film42 commented 5 years ago

This was released as 0.3.0.pre0.