summaryrefslogtreecommitdiff
path: root/migrate/versioning/api.py
diff options
context:
space:
mode:
authorchristian.simms <unknown>2008-04-06 20:58:37 +0000
committerchristian.simms <unknown>2008-04-06 20:58:37 +0000
commit8af121c421f45a108894f56c8f713ae455410020 (patch)
tree0fef911c6c38f1fb8f149bb1848e0b5ecadcbf85 /migrate/versioning/api.py
parentc13931b6b911dde2b3732c23428da7be64786a9e (diff)
downloadsqalchemy-migrate-8af121c421f45a108894f56c8f713ae455410020.tar.gz
Change make_update_script_for_model shell command to compare two versions of Python model (issue #12); add shell test for new diff'ing apis
Diffstat (limited to 'migrate/versioning/api.py')
-rw-r--r--migrate/versioning/api.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/migrate/versioning/api.py b/migrate/versioning/api.py
index 32ed33f..e65d7d5 100644
--- a/migrate/versioning/api.py
+++ b/migrate/versioning/api.py
@@ -301,18 +301,18 @@ def create_model(url,repository,**opts):
engine=create_engine(url)
print cls_schema.create_model(engine,repository)
-def make_update_script_for_model(path,url,model,repository,**opts):
- """%prog make_update_script_for_model PATH URL MODEL REPOSITORY_PATH
+def make_update_script_for_model(url,oldmodel,model,repository,**opts):
+ """%prog make_update_script_for_model URL OLDMODEL MODEL REPOSITORY_PATH
- Create a script changing the current (old) database to the current (new) Python model.
+ Create a script changing the old Python model to the new (current) Python model, sending to stdout.
NOTE: This is EXPERIMENTAL.
""" # TODO: get rid of EXPERIMENTAL label
engine=create_engine(url)
try:
- cls_script_python.make_update_script_for_model(path,engine,model,repository,**opts)
+ print cls_script_python.make_update_script_for_model(engine,oldmodel,model,repository,**opts)
except exceptions.PathFoundError,e:
- raise exceptions.KnownError("The path %s already exists"%e.args[0])
+ raise exceptions.KnownError("The path %s already exists"%e.args[0]) # TODO: get rid of this? if we don't add back path param
def update_db_from_model(url,model,repository,**opts):
"""%prog update_db_from_model URL MODEL REPOSITORY_PATH