Skip to content
This repository has been archived by the owner on Nov 13, 2019. It is now read-only.

Change job_attrs type to text #65

Closed
ericfranz opened this issue Apr 14, 2016 · 4 comments
Closed

Change job_attrs type to text #65

ericfranz opened this issue Apr 14, 2016 · 4 comments
Milestone

Comments

@ericfranz
Copy link
Contributor

The type for this is a string - this is dangerous when using this for a store. text should be used instead, which doesn't have the size limits that string has

https://github.com/AweSim-OSC/osc-jobconstructor/blob/68aadf2022b5f6b6243513d650a6fe46f406c338/db/schema.rb#L29

@brianmcmichael
Copy link
Contributor

sqlite string max length = 2147483647
ruby string max length = 2**31 - 1

If this is an issue we shouldn't be using store

@ericfranz
Copy link
Contributor Author

When specifying a rails type "string" this corresponds to a column in MySQL that has a limit of 255 characters and its the same (or similar) in Postgres. In Rails schemas "text" is the proper type to use for strings that are likely to exceed this limit, even if sqlite3 would let us get away with packing more into the column.

@ericfranz
Copy link
Contributor Author

To clarify, in MySQL :string is mapped to VARCHAR which has the 255 char limit but :text is mapped to TINYTEXT, TEXT, MEDIUMTEXT, or LONGTEXT2 whose limit is much larger (max string length)

@brianmcmichael
Copy link
Contributor

done be2bb3b

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

No branches or pull requests

2 participants