From: olivier Date: Tue, 19 Jan 2010 18:08:03 +0000 (+0000) Subject: add media_collections.is_published X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=ab62d41faa88b8458ec20560caa33182c079264e;p=telemeta-data.git add media_collections.is_published git-svn-id: http://svn.parisson.org/svn/crem@135 3bf09e05-f825-4182-b9bc-eedd7160adf0 --- diff --git a/trunk/docref/crem.sql b/trunk/docref/crem.sql index 550f795..4a6846b 100644 --- a/trunk/docref/crem.sql +++ b/trunk/docref/crem.sql @@ -192,6 +192,7 @@ CREATE TABLE media_collections ( collector VARCHAR(250) NOT NULL DEFAULT '', collector_is_creator BOOLEAN NOT NULL DEFAULT 0, publisher_id INTEGER, + is_published BOOLEAN NOT NULL DEFAULT 0, year_published INTEGER NOT NULL DEFAULT 0, publisher_collection_id INTEGER, publisher_serial VARCHAR(250) NOT NULL DEFAULT '', diff --git a/trunk/docref/docref.odt b/trunk/docref/docref.odt index 5d8a3d0..413bf32 100644 Binary files a/trunk/docref/docref.odt and b/trunk/docref/docref.odt differ diff --git a/trunk/import/migration/tasks/collections.py b/trunk/import/migration/tasks/collections.py index a22aad6..fccfbca 100644 --- a/trunk/import/migration/tasks/collections.py +++ b/trunk/import/migration/tasks/collections.py @@ -346,7 +346,22 @@ class CollectionsCollectorNormalizer(DataMigrator): return "collections:collector" def process(self): + self.start() self.target_cursor.execute("UPDATE media_collections SET collector_is_creator = 0") self.target_cursor.execute("UPDATE media_collections SET collector_is_creator = (collector IN ('=', '=+N', 'ID' 'ID.' 'IDE.' 'IDEM'))") self.stats['flagged'] = self.target_cursor.rowcount + self.end() + +class CollectionsPublishedStateMigrator(DataMigrator): + """Update is_published collections state""" + + implements(IDataMigrator) + def get_name(self): + return "collections:is_published" + + def process(self): + self.start() + self.target_cursor.execute("UPDATE media_collections SET is_published = (old_code LIKE 'DI.%')") + self.stats['published'] = self.target_cursor.rowcount + self.end()