[Koha-devel] SQL92 keywords and naming columns
David Cook
dcook at prosentient.com.au
Tue May 31 07:21:17 CEST 2016
I was wondering if we have any advice for naming columns, especially
TIMESTAMP columns, so I looked on the wiki and found that we're not supposed
to use SQL92 keywords:
https://wiki.koha-community.org/wiki/Coding_Guidelines#SQL2:_SQL92_keywords
I'm not super familiar with all the keywords, but I'm confident that
"timestamp" is one of those keywords. Here's the distribution on a dev Koha
I have:
'created', 1
'created_on', 2
'date', 1
'dateadded', 1
'date_uploaded', 2
'dtcreated', 1
'lastmodified', 1
'message_date', 1
'modification_time', 1
'needed', 1
'time', 2
'timestamp', 26
'time_queued', 1
'updated', 1
'upload_timestamp', 2
'validated', 1
'valid_until', 1
I thought I'd check out DATETIME as well. Interestingly, there is a DATETIME
column named "timestamp" as well:
'datearrived', 1
'datereviewed', 1
'datesent', 1
'datetime', 1
'date_approved', 1
'date_created', 3
'date_due', 2
'date_modified', 1
'date_run', 1
'issuedate', 2
'itemlost_on', 2
'lastreneweddate', 2
'last_modified', 1
'last_run', 1
'returndate', 2
'sharedate', 1
'start_time', 1
'suspend_until', 2
'timeclicked', 1
'timestamp', 1
'withdrawn_on', 2
It seems undesirable to use timestamp for things like "upload_timestamp" and
"message_date" as well, as TIMESTAMP will automatically update when that row
is updated as per these conditions:
http://dev.mysql.com/doc/refman/5.7/en/timestamp-initialization.html.
Anyway, something to think about.
David Cook
Systems Librarian
Prosentient Systems
72/330 Wattle St
Ultimo, NSW 2007
Office: 02 9212 0899
Direct: 02 8005 0595
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20160531/3a64eb19/attachment.html>
More information about the Koha-devel
mailing list