0

I am evaluating SQLAlchemy-migrate as a database migration tool. My db_version is 0, and the repository version is 1.

$ python manage.py db_version --url=postgresql://localhost:5432/my_db
0

$ python manage.py version
1

and I only have one unapplied version:

./versions/001_initial_schema_postgres_upgrade.sql

I run the migration tool, but it won't upgrade because it can't find the version:

$ python manage.py upgrade --version 1 --url=postgresql://localhost:5432/my_db

"There is no script for %d version" % self.version
AssertionError: There is no script for 1 version

Am I doing something wrong so that the migrate tool can't find my change script?

  • 1
    I know that this isn't answering your question, but I haven't used SQLAlchemy-migrate and so I thought I'd have a look at the [source](https://github.com/openstack/sqlalchemy-migrate). It doesn't seem to be very actively maintained (e.g. latest python they have tested on is 3.4 which was released in 2014). If you are just learning and want to try something more actively maintained try [alembic](https://alembic.zzzcomputing.com/en/latest/) which is another sqlalchemy based migration tool. If you need/prefer to use sqlalchemy-migrate then feel free to disregard! – SuperShoot Nov 11 '18 at 09:00
  • Thanks! I’ll take a look at alembic. – wrattlesnake_wrangler Nov 11 '18 at 17:04

0 Answers0