Skip to content
This repository

Allowing bytea columns to migrate by ignoring length #33

merged 1 commit into from almost 3 years ago

4 participants

miegs3 Piotr Solnica Christian Meier Jordan Ritter

I found that I was unable to migrate into postgres when defining a binary property because the column was being defined with the default length.
Currently TEXT, CLOB and NVARCHAR were ignoring the length so I've added bytea to this list.

Jordan Ritter

Seems fine.

cc: @solnic

Piotr Solnica solnic merged commit 4713f67 into from
Piotr Solnica solnic closed this
Piotr Solnica

@miegs3 thanks!

Christian Meier

will that see a release one day ? kind of difficult to monkey patch this to get datamapper migration working on heroku:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Oct 04, 2011
miegs3 miegs3 Ignore the length property for bytea columns. f091e37
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  lib/dm-migrations/adapters/dm-do-adapter.rb
2  lib/dm-migrations/adapters/dm-do-adapter.rb
@@ -202,7 +202,7 @@ def property_schema_hash(property)
202 202
203 203 schema_primitive = schema[:primitive]
204 204
205   - if dump_class.equal?(String) && schema_primitive != 'TEXT' && schema_primitive != 'CLOB' && schema_primitive != 'NVARCHAR'
  205 + if dump_class.equal?(String) && schema_primitive != 'TEXT' && schema_primitive != 'CLOB' && schema_primitive != 'NVARCHAR' && schema_primitive != 'BYTEA'
206 206 schema[:length] = property.length
207 207 elsif dump_class.equal?(BigDecimal) || dump_class.equal?(Float)
208 208 schema[:precision] = property.precision

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.