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 '',
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()