* Cédric Krier: " Re: [tryton-dev] Database schema name limit" (Sat, 23 May
2015 12:18:32 +0200):
As we seem to have a maximal length of 64, I would propose to just truncate
table names, that hit that limit and to number them for avoidance of
collisions, e.g.:
table_name_longer_than_sixtyfour_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
would transform to
table_name_longer_than_sixtyfour_xxxxxxxxxxxxxxxxxxxxxxxxxx_001
If that maximal table name length cannot be determined automatically
(with python-sql or by some other means) this could be
the configuration parameter 'table_name_max_length'.
Additionally we could introduce the configuration option
'table_element_length'
The expected results would be
e.g. with
table_element_length = 3
table_name_max_length = 32
account.invoice.payment_term.line.relativedelta => acc_inv_pay_ter_lin_rel
account.payment.sepa.message => acc_pay_sep_mes
table.name.longer.than.sixtyfour.xxxxxxxxxxxxxxxx.yyyyy =>
tab_nam_lon_tha_six_xxx_yyy
table.name.longer.than.sixtyfour.xxxxxxxxxxxxxxxx.yyyyyy.zzzzz =>
tab_nam_lon_tha_six_xxx_yyy_001
The shorter the elements will be, the less a table name of course will be
readable for its underlying model. But an algorithm like this seems to a good
compromise for me.