58 lines
1.6 KiB
Python
Raw Normal View History

"""
`PostgreSQL`_ database specific implementations of changeset classes.
.. _`PostgreSQL`: http://www.postgresql.org/
"""
from migrate.changeset import ansisql
from sqlalchemy.databases import postgres as sa_base
#import sqlalchemy as sa
PGSchemaGenerator = sa_base.PGSchemaGenerator
2008-12-02 15:25:12 +00:00
class PGSchemaGeneratorMixin(object):
"""Common code used by the PostgreSQL specific classes."""
def _do_quote_table_identifier(self, identifier):
return identifier
def _do_quote_column_identifier(self, identifier):
return '"%s"'%identifier
class PGColumnGenerator(PGSchemaGenerator, ansisql.ANSIColumnGenerator,
PGSchemaGeneratorMixin):
"""PostgreSQL column generator implementation."""
pass
2008-12-02 15:25:12 +00:00
class PGColumnDropper(ansisql.ANSIColumnDropper, PGSchemaGeneratorMixin):
"""PostgreSQL column dropper implementation."""
pass
2008-12-02 15:25:12 +00:00
class PGSchemaChanger(ansisql.ANSISchemaChanger, PGSchemaGeneratorMixin):
"""PostgreSQL schema changer implementation."""
pass
2008-12-02 15:25:12 +00:00
2008-12-02 15:41:25 +00:00
class PGConstraintGenerator(ansisql.ANSIConstraintGenerator,
PGSchemaGeneratorMixin):
"""PostgreSQL constraint generator implementation."""
pass
class PGConstraintDropper(ansisql.ANSIConstraintDropper,
PGSchemaGeneratorMixin):
"""PostgreSQL constaint dropper implementation."""
pass
class PGDialect(ansisql.ANSIDialect):
columngenerator = PGColumnGenerator
columndropper = PGColumnDropper
schemachanger = PGSchemaChanger
constraintgenerator = PGConstraintGenerator
constraintdropper = PGConstraintDropper