From b9d3d4be0a931b00a4d96b39ce61e1a374870ad3 Mon Sep 17 00:00:00 2001 From: Torsten Werner Date: Tue, 11 Jan 2011 20:24:49 +0000 Subject: [PATCH] add a script create_pickle_file.py for updating the metadata Signed-off-by: Torsten Werner --- tests/create_pickle_file.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 tests/create_pickle_file.py diff --git a/tests/create_pickle_file.py b/tests/create_pickle_file.py new file mode 100755 index 00000000..55843a91 --- /dev/null +++ b/tests/create_pickle_file.py @@ -0,0 +1,19 @@ +#!/usr/bin/python + +# recreate the pickle file db-metadata-*.pkl that needs to be updated +# after a database upgrade + +from base_test import fixture +from daklib.dbconn import DBConn + +from sqlalchemy import create_engine, __version__ + +import pickle + +pickle_filename = fixture('db-metadata-%s.pkl' % __version__) +pickle_file = open(pickle_filename, 'w') +metadata = DBConn().db_meta +pickle.dump(metadata, pickle_file) +pickle.dump(metadata.ddl_listeners, pickle_file) +pickle_file.close() +print "File %s has been updated successfully." % pickle_filename -- 2.39.5