MetaData Sharing
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1.0 KiB

New Version
-----------

To create a revision, update the ORM in medashare/orm.py.

Then in the medashare directory, run:
```
./autogen.sh "message of what you did"
```

This will create a version file. Edit the version file to support the
migration (such as populating new columns).

Once things are tested as good, commit everything.

Differences from template
-------------------------

There are a couple difference, first the `alembic.ini` file
was updated:
```
sqlalchemy.url = sqlite+pysqlite:///:memory:
```

This lets the `--autogenerate` work properly.

The second is that the `env.py:run_migrations_online` was updated with:
```
if 'engine' in config.attributes:
connectable = config.attributes['engine']
else:
```
so that the engine could be passed in directly as opposed to
opening the file again, or passing in the url.

TODO
----

Figure out how to automatically add the `medashare.orm` import to
the script. The template implies that there is a way, but don't know
where the config comes from.