diff options
| author | percious17 <unknown> | 2008-12-02 05:11:36 +0000 |
|---|---|---|
| committer | percious17 <unknown> | 2008-12-02 05:11:36 +0000 |
| commit | 9f0bd657f41fad8f8737199f383564ceb0803336 (patch) | |
| tree | cb01d2c60ff1890052ac30ab58658167bb829904 /migrate/changeset/databases | |
| parent | 1909dc8888ee8f62c87b9b1bf026909ed7b710d2 (diff) | |
| download | sqlalchemy-migrate-9f0bd657f41fad8f8737199f383564ceb0803336.tar.gz | |
most of the tests are now working with nose.
Diffstat (limited to 'migrate/changeset/databases')
| -rw-r--r-- | migrate/changeset/databases/mysql.py | 18 | ||||
| -rw-r--r-- | migrate/changeset/databases/postgres.py | 3 | ||||
| -rw-r--r-- | migrate/changeset/databases/sqlite.py | 3 |
3 files changed, 21 insertions, 3 deletions
diff --git a/migrate/changeset/databases/mysql.py b/migrate/changeset/databases/mysql.py index 1a87ff3..aa65166 100644 --- a/migrate/changeset/databases/mysql.py +++ b/migrate/changeset/databases/mysql.py @@ -5,9 +5,15 @@ from sqlalchemy.databases import mysql as sa_base MySQLSchemaGenerator = sa_base.MySQLSchemaGenerator class MySQLColumnGenerator(MySQLSchemaGenerator,ansisql.ANSIColumnGenerator): + def _do_quote_table_identifier(self, identifier): + return '%s'%identifier pass class MySQLColumnDropper(ansisql.ANSIColumnDropper): - pass + def _do_quote_table_identifier(self, identifier): + return '%s'%identifier + def _do_quote_column_identifier(self, identifier): + return '%s'%identifier + class MySQLSchemaChanger(MySQLSchemaGenerator,ansisql.ANSISchemaChanger): def visit_column(self,delta): keys = delta.keys() @@ -34,8 +40,13 @@ class MySQLSchemaChanger(MySQLSchemaGenerator,ansisql.ANSISchemaChanger): def visit_index(self,param): # If MySQL can do this, I can't find how raise exceptions.NotSupportedError("MySQL cannot rename indexes") + def _do_quote_table_identifier(self, identifier): + return '%s'%identifier + class MySQLConstraintGenerator(ansisql.ANSIConstraintGenerator): - pass + def _do_quote_table_identifier(self, identifier): + return '%s'%identifier + class MySQLConstraintDropper(ansisql.ANSIConstraintDropper): #def visit_constraint(self,constraint): # if isinstance(constraint,sqlalchemy.schema.PrimaryKeyConstraint): @@ -54,6 +65,9 @@ class MySQLConstraintDropper(ansisql.ANSIConstraintDropper): self.append(constraint.name) self.execute() + def _do_quote_table_identifier(self, identifier): + return '%s'%identifier + class MySQLDialect(ansisql.ANSIDialect): columngenerator = MySQLColumnGenerator columndropper = MySQLColumnDropper diff --git a/migrate/changeset/databases/postgres.py b/migrate/changeset/databases/postgres.py index acd6f6c..533a5f4 100644 --- a/migrate/changeset/databases/postgres.py +++ b/migrate/changeset/databases/postgres.py @@ -20,7 +20,8 @@ class PGSchemaChanger(ansisql.ANSISchemaChanger): class PGConstraintGenerator(ansisql.ANSIConstraintGenerator): - pass + def _do_quote_table_identifier(self, identifier): + return identifier class PGConstraintDropper(ansisql.ANSIConstraintDropper): pass diff --git a/migrate/changeset/databases/sqlite.py b/migrate/changeset/databases/sqlite.py index ebaa1de..a0b85d2 100644 --- a/migrate/changeset/databases/sqlite.py +++ b/migrate/changeset/databases/sqlite.py @@ -24,6 +24,9 @@ class SQLiteSchemaChanger(ansisql.ANSISchemaChanger): return self._not_supported('ALTER TABLE') def visit_index(self,param): self._not_supported('ALTER INDEX') + def _do_quote_column_identifier(self, identifier): + return '"%s"'%identifier + class SQLiteConstraintGenerator(ansisql.ANSIConstraintGenerator): def visit_migrate_primary_key_constraint(self,constraint): tmpl = "CREATE UNIQUE INDEX %s ON %s ( %s )" |
