Hi Mike, Thank you very much for your detailed reply. I hasn't came across TEXT data type before, I just Google it and seems not a ISO standard data type, only specific to postgreSQL, but it does have the advantage you mentioned. And yes we are building a new system and will be using PostgreSQL.
So is this fieldtypepostnew.xml a recommended one to use for all new OFBIZ system please? Will it have any bad side effect since it's not a standard data type please? E.g. in future upgrade etc... Thank you very much! Kind Regards Fong On Wed, May 1, 2013 at 3:52 AM, Mike <[email protected]> wrote: > Compare the following three files: > > framework/entity/fieldtype/fieldtypemysql.xml > framework/entity/fieldtype/fieldtypepostgres.xml > framework/entity/fieldtype/fieldtypepostnew.xml > > I bet you are using mysql, or maybe even postgres, which has very LIMITED > key value lengths. In the real world, you never know what key length you > may need in the future, so why limit yourself? Now take a look at > "postnew", which uses a generic "text" type for almost all the fields. It > allows ANY key length, which allows the flexibility to create logical > relations, even for part numbers that may be 60 characters or so. > > I learned this the hard way, when I came across long part numbers, and > struggled to figure out a way to logically store them. Back then I was > using mysql. I made the hard conversion to postgres, using > "postnew", defined in: > > framework/entity/config/entityengine.xml: > <datasource name="localpostnew" > field-type-name="postnew" > > And never had a problem since. You can then use UUID for anything. > > > > On Tue, Apr 30, 2013 at 3:38 AM, Ofbiz 开发 <[email protected]> wrote: > > > Hi everyone, > > > > I am considering using Java UUID for the ProductID ( > > http://docs.oracle.com/javase/7/docs/api/java/util/UUID.html ), but that > > requires at least varchar (32), and the current ProductID field in > database > > is only varchar(20), how hard is it to change to varchar(32) please? Is > > there any plan in Ofbiz trunk to change this to varchar(32) please? It > > seems better than using sequence. > > > > Thanks. > > > > Kind Regards > > > > Fong > > >
