qizhiyi / sqlalchemy-migrate

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

Api test downgrade/upgrade does not work with sql scripts #83

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
http://code.google.com/p/sqlalchemy-
migrate/source/browse/migrate/versioning/api.py#213

Arguments about database name and operation needs to be passed when 
acquiring sql script.

Original issue reported on code.google.com by iElect...@gmail.com on 24 Mar 2010 at 3:47

GoogleCodeExporter commented 8 years ago
Patch fixes it. The db and operation kwargs are ignored in the case of a script 
migration, so, yeah, easy enough.

-jag

Original comment by jag%flowtheory.net@gtempaccount.com on 28 Feb 2011 at 7:18

Attachments:

GoogleCodeExporter commented 8 years ago
This still doesn't work for 0.7.1. The patch doesn't help. What's the point of 
supporting sql scripts if upgrade/downgrade/test don't work for them? Is this 
going to be fixed soon?

Original comment by wyue...@gmail.com on 2 Oct 2011 at 11:20

GoogleCodeExporter commented 8 years ago
It seems that the self.sql dict keys the postgresql sql scripts using 
'postgres', but after parsing the db url, the database parameter passed to 
script() is keyed with "postgresql" instead so self.sql doesn't return anything.

Original comment by wyue...@gmail.com on 2 Oct 2011 at 11:34

GoogleCodeExporter commented 8 years ago
Renaming the .sql scripts from 001_postgres_*.sql to 001_postgresql_*.sql works 
around this problem. I think this problem can be address by updating the 
script_sql command's help text. Instead of 'postgres', 'postgresql' should be 
used because the SQLAlchemy url starts with 'postgresql'.

script_sql's help text has another discrepencies with the name of the downgrade 
script as well.

instead of:
repository/versions/001_postgresql_postgres.sql

it should be:
repository/versions/001_postgresql_downgrade.sql

Original comment by wyue...@gmail.com on 2 Oct 2011 at 11:41

GoogleCodeExporter commented 8 years ago
I've implemented the patch from jag%25flowtheory.net@gtempaccount.com to my 
clone in changeset:

http://code.google.com/r/wyuenho-sqlalchemy-migrate/source/detail?r=2f7ff632824f
0b82dc4a43185397aa6819554345

Please review this and do a pull. Hopefully you can guys make a release soon.

The fix for the help text is done in a separate issue. See issue 129.

Original comment by wyue...@gmail.com on 2 Oct 2011 at 12:18

GoogleCodeExporter commented 8 years ago

Original comment by jan.ditt...@gmail.com on 28 Oct 2011 at 9:09

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 2f7ff632824f.

Original comment by jan.ditt...@gmail.com on 28 Oct 2011 at 9:11