From c7cbde7fea78c48b4fab51c59dbfa1d594bdc680 Mon Sep 17 00:00:00 2001 From: percious17 Date: Wed, 26 Nov 2008 22:05:19 +0000 Subject: added hook functions which allow the dialects to specify how to indicate identifiers, as this is different in postgres. Also, this fix includes a fix for modification of columns which have tables definied within a schema. This was also broken in postgres. --- migrate/changeset/databases/postgres.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'migrate/changeset/databases/postgres.py') diff --git a/migrate/changeset/databases/postgres.py b/migrate/changeset/databases/postgres.py index adbd3fb..4cba777 100644 --- a/migrate/changeset/databases/postgres.py +++ b/migrate/changeset/databases/postgres.py @@ -5,13 +5,22 @@ from sqlalchemy.databases import postgres as sa_base PGSchemaGenerator = sa_base.PGSchemaGenerator class PGColumnGenerator(PGSchemaGenerator,ansisql.ANSIColumnGenerator): - pass + def _do_quote_table_identifier(self, identifier): + return identifier + class PGColumnDropper(ansisql.ANSIColumnDropper): pass + class PGSchemaChanger(ansisql.ANSISchemaChanger): - pass + def _do_quote_table_identifier(self, identifier): + return identifier + def _do_quote_column_identifier(self, identifier): + return '"%s"'%identifier + + class PGConstraintGenerator(ansisql.ANSIConstraintGenerator): pass + class PGConstraintDropper(ansisql.ANSIConstraintDropper): pass -- cgit v1.2.1