From dad318c16d5d455320d0fac2ad780758fba7e50d Mon Sep 17 00:00:00 2001 From: olivier Date: Fri, 2 May 2008 21:55:21 +0000 Subject: [PATCH] collection id analysis: fix year and add complete table def git-svn-id: http://svn.parisson.org/svn/crem@14 3bf09e05-f825-4182-b9bc-eedd7160adf0 --- docref/tools/analyse_collection_ids.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/docref/tools/analyse_collection_ids.py b/docref/tools/analyse_collection_ids.py index 9a08efc..e5dfeaf 100644 --- a/docref/tools/analyse_collection_ids.py +++ b/docref/tools/analyse_collection_ids.py @@ -3,15 +3,16 @@ import _mysql_exceptions import re from sys import stdout -# mysql> describe coll; -# +--------+--------------+------+-----+---------+-------+ -# | Field | Type | Null | Key | Default | Extra | -# +--------+--------------+------+-----+---------+-------+ -# | cote | varchar(255) | YES | UNI | NULL | | -# | format | varchar(255) | YES | | NULL | | -# | regex | varchar(255) | YES | | NULL | | -# | new_id | varchar(64) | YES | UNI | NULL | | -# +--------+--------------+------+-----+---------+-------+ +""" +CREATE TABLE `coll` ( + `cote` varchar(255) default NULL, + `format` varchar(255) default NULL, + `regex` varchar(255) default NULL, + `new_id` varchar(64) default NULL, + UNIQUE KEY `new_id` (`new_id`), + UNIQUE KEY `cote` (`cote`) +) +""" collection_patterns = [ @@ -91,7 +92,7 @@ for pattern in collection_patterns: if year < 100: year += 2000 else: - year += 1900 + year += 1000 tokens.append(str(year)) tokens.append(str(serial).rjust(3, '0')) -- 2.39.5