GNOME Bugzilla – Bug 560165
field definitions could be streamlined
Last modified: 2018-06-29 22:12:28 UTC
I stumbled upon this when I tried to add a second table as an extension to the accounts table to hold some additional fields. I need them for some reports from the German standard chart of account SKR04. I tried to add a child table with 'code' as the foreign primary key. That failed because varchar(2048) is too big to be a primary key.
Created attachment 122332 [details] suggestions for field types I was told in #mysql to run "SELECT * FROM accounts PROCEDURE ANALYSE( 0, 0);" in mysql to find out about more appropriate values for the field types. Maybe they can serve as a general suggestion.
I'm open to suggestions to improve the fields. In general, the direction from the gnucash-devel list has been that strings should be of unlimited length. Of course, this is not possible with an SQL db, so that is where the 2048 length comes from. I don't know whether 'code' could be shorted or not.
I certainly think the fields need to be shortened. Maybe some discussion in #mysql would help make an educated decision. I think that the fields should mostly not exceed the length suitable for a primary key to make it possible to add external tables with foreign keys.
Nothing is going to be done for now. Perhaps a future release.
GnuCash bug tracking has moved to a new Bugzilla host. The new URL for this bug is https://bugs.gnucash.org/show_bug.cgi?id=560165. Please continue processing the bug there and please update any external references or bookmarks.