Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

Commit

Permalink
Add creation_time and modification_time DB columns
Browse files Browse the repository at this point in the history
This will permits to know if non-updated data exist.
  • Loading branch information
joubu committed Nov 7, 2014
1 parent 6f30642 commit 9b48cc3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/Hea/Library.pm
Expand Up @@ -25,8 +25,8 @@ sub create {

my $dbh = Hea::Dbh::dbh;
my $sql = q{
INSERT INTO library (library_id, name, url, library_type, country)
VALUES (?, ?, ?, ?, ?)
INSERT INTO library (library_id, name, url, library_type, country, creation_time)
VALUES (?, ?, ?, ?, ?, NOW())
};

$library->{type} ||= '';
Expand Down
4 changes: 3 additions & 1 deletion schema.sql
Expand Up @@ -5,7 +5,9 @@ CREATE TABLE library (
kohaversion VARCHAR(255) NULL DEFAULT NULL,
url VARCHAR(255) NULL DEFAULT NULL,
library_type VARCHAR(255) NOT NULL DEFAULT '',
country VARCHAR(255) NOT NULL DEFAULT ''
country VARCHAR(255) NOT NULL DEFAULT '',
creation_time TIMESTAMP NOT NULL,
modification_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS volumetry;
Expand Down

0 comments on commit 9b48cc3

Please sign in to comment.