views:

19

answers:

2

What the best way to store CSPC and UPC codes are in Rails? I used integers with SQLite, but had overflow issues when moving to production. I've since switch to strings, but am not sure if a better generic datatype (needs to support SQLite, MySQL and PostgreSQL).

Thanks.

+1  A: 

Strings are a solid choice when you need generic like in your case. You should be fine.

x1a4
+1  A: 

In the project I am currently working on, we do not use rails, we use .NET and SQL server, we have it stored in two formats, nvarchar (or varchar in your case) and a bigint.

Francisco Soto