qizhiyi / sqlalchemy-migrate

Automatically exported from code.google.com/p/sqlalchemy-migrate
MIT License
0 stars 0 forks source link

Support for naming convention with the underscore #155

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
SQLAlchemy-migrate supports both python scripts and sql scripts to change the 
schema. For the sql scripts, it is necessary to have the database or database 
adaptor name within the name of the script.

The underscore '_' is used as a key word to separate the version, database name 
and the operation. Durng parsing the script name by splitting it with '_', the 
first part is taken as the version, and the last part s taken as the operation. 
For the database name only one part before the last part is taken. This will 
lead to an uncomplete database name. For example, if the database name is like 
db_XXX_ap, the database from the parsing is only ap.

This issue is easy to resolve by modifying the code
dbms = parts[-2] 
into           
dbms = basename[len(version+'_'):][:-len('_'+op)]
in migrate/versioning/version.py.

Original issue reported on code.google.com by sb...@cn.ibm.com on 14 Jan 2013 at 7:53

GoogleCodeExporter commented 8 years ago

Original comment by jan.ditt...@gmail.com on 9 Feb 2013 at 12:30