[Bug 39176] New: Update additional_field_values.record_id to varchar(255)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39176 Bug ID: 39176 Summary: Update additional_field_values.record_id to varchar(255) Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org In bug 38663 we had to switch from int(11) to varchar(11) so we could properly store branchcode, the primary key for the branches table. In bug 38457 I'm now faced with the same issue of needing to update the field from varchar(11) to varchar(80) to allow for the code field in the account_debit_types table which is a varchar(80) primary key. Looking to the future and how we're starting to add more and more uses of additional fields I think we should pick the largest current primary key field and match that. SELECT t.TABLE_NAME AS table_name, k.COLUMN_NAME AS primary_key_field, CASE WHEN k.CHARACTER_MAXIMUM_LENGTH IS NOT NULL THEN CONCAT(k.DATA_TYPE, '(', k.CHARACTER_MAXIMUM_LENGTH, ')') WHEN k.NUMERIC_PRECISION IS NOT NULL THEN CONCAT(k.DATA_TYPE, '(', k.NUMERIC_PRECISION, ')') ELSE k.DATA_TYPE END AS primary_key_type FROM INFORMATION_SCHEMA.TABLES t JOIN INFORMATION_SCHEMA.COLUMNS k ON t.TABLE_NAME = k.TABLE_NAME AND t.TABLE_SCHEMA = k.TABLE_SCHEMA JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE ku ON t.TABLE_NAME = ku.TABLE_NAME AND t.TABLE_SCHEMA = ku.TABLE_SCHEMA AND k.COLUMN_NAME = ku.COLUMN_NAME JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc ON ku.TABLE_NAME = tc.TABLE_NAME AND ku.TABLE_SCHEMA = tc.TABLE_SCHEMA AND ku.CONSTRAINT_NAME = tc.CONSTRAINT_NAME WHERE t.TABLE_SCHEMA = DATABASE() AND tc.CONSTRAINT_TYPE = 'PRIMARY KEY' ORDER BY t.TABLE_NAME; Using the above query, I believe that shows the largest is a varchar(255). -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39176 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com | |, | |nick@bywatersolutions.com, | |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39176 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |CONFIRMED Keywords| |Academy -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org