[Koha-devel] Ambiguous column names

David Cook dcook at prosentient.com.au
Thu Nov 13 04:51:32 CET 2014


Actually, after looking at the `issues` and `reserves` tables, I'm really in favour of getting rid of "timestamp" columns and renaming them more contextually.

In the case of `reserves`, I have no idea what `timestamp` means. There's already `reservedate`, `notificationdate`, `reminderdate`, `waitingdate`. It's probably `updated` in that case? As `reservedate` would be `created`?

In the case of `issues`, there is already `date_due`, `lastreneweddate`, `returndate`, `issuedate`. I imagine `issuedate` would be `created`. It looks like `timestamp` is `updated` . As I look, it usually matches `lastreneweddate` although timestamp has time while the other does not. 

I wonder how much we actually use `timestamp` in the code... 

Of course, if we do change column names, then we'll be screwing up a lot of the existing SQL reports that people have out there which may or may not use timestamp for dating...

David Cook
Systems Librarian
Prosentient Systems
72/330 Wattle St, Ultimo, NSW 2007

> -----Original Message-----
> From: koha-devel-bounces at lists.koha-community.org [mailto:koha-devel-
> bounces at lists.koha-community.org] On Behalf Of Robin Sheat
> Sent: Thursday, 13 November 2014 1:03 PM
> To: koha-devel at lists.koha-community.org
> Subject: Re: [Koha-devel] Ambiguous column names
> 
> David Cook schreef op do 13-11-2014 om 12:12 [+1100]:
> > I think the best option, if we were to change away from timestamp,
> > would have to be "lastmodified", as timestamp types will get updated
> > after every insert/update, I believe. But since they'd all be called
> > "lastmodified", changing it from "timestamp" would become a bit moot,
> > I think.
> 
> Well, I was thinking both, "created" and "updated." So you know when the
> record was created, and when it was last changed. Both very handy for
> simple auditing or bug finding.
> 
> It's possible to have a timestamp field that is initialised to the current date
> automatically on creation, and another that is auto updated.
> 
> http://dev.mysql.com/doc/refman/5.1/en/timestamp-initialization.html
> 
> This would nicely mean that there's no code at all in Koha required to
> maintain this.
> 
> Anyway, I was just sticking my oar in, I've no desire to bikeshed it into the
> ground, anything is better than nothing :)
> 
> --
> Robin Sheat
> Catalyst IT Ltd.
> ✆ +64 4 803 2204
> GPG: 5FA7 4B49 1E4D CAA4 4C38  8505 77F5 B724 F871 3BDF




More information about the Koha-devel mailing list