ConsultingMD / activerecord5-redshift-adapter

Other
45 stars 155 forks source link

'text' is not a valid data type with Redshift #3

Open RoryO opened 7 years ago

RoryO commented 7 years ago

It's common to use text in an AR migration to define a wide column that contains many characters. Redshift does not support a text datatype, but it does support varchar up to 65535. Therefore, we should change the definition of text in a migration to generate VARCHAR(65535) instead of VARCHAR(255), which what happens now and likely surprising behavior.

I'm up in the air if we want to throw some sort of warning about this. A 64k wide column probably isn't what you actually want, but you likely want something bigger than 255.

seivan commented 7 years ago

We store large swats of HTML in our text and we would actually like a default of VARCHAR(65535) as text, so I second this.