diff options
author | iElectric <unknown> | 2009-06-27 14:33:40 +0000 |
---|---|---|
committer | iElectric <unknown> | 2009-06-27 14:33:40 +0000 |
commit | 75e93aa4106c914b9870fae5435935db86ed0c10 (patch) | |
tree | ce409c5b2194275c37ceef86c1b83f589571a961 /migrate/changeset/databases/sqlite.py | |
parent | 5a06b033d22b21f6838571de85791f6ce95f2b1a (diff) | |
download | sqlalchemy-migrate-75e93aa4106c914b9870fae5435935db86ed0c10.tar.gz |
add not supported exceptions for sqlite constraints
Diffstat (limited to 'migrate/changeset/databases/sqlite.py')
-rw-r--r-- | migrate/changeset/databases/sqlite.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/migrate/changeset/databases/sqlite.py b/migrate/changeset/databases/sqlite.py index 479cf45..59902b4 100644 --- a/migrate/changeset/databases/sqlite.py +++ b/migrate/changeset/databases/sqlite.py @@ -83,7 +83,7 @@ class SQLiteSchemaChanger(SQLiteHelper, ansisql.ANSISchemaChanger): self._not_supported('ALTER INDEX') -class SQLiteConstraintGenerator(ansisql.ANSIConstraintGenerator): +class SQLiteConstraintGenerator(ansisql.ANSIConstraintGenerator, SQLiteCommon): def visit_migrate_primary_key_constraint(self, constraint): tmpl = "CREATE UNIQUE INDEX %s ON %s ( %s )" @@ -94,8 +94,15 @@ class SQLiteConstraintGenerator(ansisql.ANSIConstraintGenerator): self.append(msg) self.execute() + def visit_migrate_foreign_key_constraint(self, *p, **k): + self._not_supported('ALTER TABLE ADD CONSTRAINT') -class SQLiteConstraintDropper(ansisql.ANSIColumnDropper, ansisql.ANSIConstraintCommon): + def visit_migrate_unique_constraint(self, *p, **k): + self._not_supported('ALTER TABLE ADD CONSTRAINT') + +class SQLiteConstraintDropper(ansisql.ANSIColumnDropper, + SQLiteCommon, + ansisql.ANSIConstraintCommon): def visit_migrate_primary_key_constraint(self, constraint): tmpl = "DROP INDEX %s " @@ -104,7 +111,16 @@ class SQLiteConstraintDropper(ansisql.ANSIColumnDropper, ansisql.ANSIConstraintC self.append(msg) self.execute() -# TODO: add not_supported tags for constraint dropper/generator + def visit_migrate_foreign_key_constraint(self, *p, **k): + self._not_supported('ALTER TABLE DROP CONSTRAINT') + + def visit_migrate_check_constraint(self, *p, **k): + self._not_supported('ALTER TABLE DROP CONSTRAINT') + + def visit_migrate_unique_constraint(self, *p, **k): + self._not_supported('ALTER TABLE DROP CONSTRAINT') + + # TODO: technically primary key is a NOT NULL + UNIQUE constraint, should add NOT NULL to index class SQLiteDialect(ansisql.ANSIDialect): |