Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out data migrations #4

Closed
bochecha opened this issue Jun 24, 2019 · 1 comment
Closed

Figure out data migrations #4

bochecha opened this issue Jun 24, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@bochecha
Copy link
Contributor

Right now, event handlers can define their custom model to store data in them. The tables are created before running Azafea, with the initdb command.

However, if an existing model needs to change its schema, then we would have no way other than moving its current data to a different table, then running initdb again and finally moving the old data into the new table with an ad-hoc script.

We can probably do something better with Alembic, adding a new migrate command which would run the migrations of all the models associated to configured queues.

This will also require some documentation:

  • the page about how to write custom handlers will need some additions for writing migrations;
  • the deployment page will need to cover how to run migrations.
@bochecha bochecha added the enhancement New feature or request label Jun 24, 2019
bochecha added a commit that referenced this issue Dec 6, 2019
Queue handlers usually come with their data models. Up until now, the
only way to create them was through the initdb command, which only works
to create new models, but not to modify existing ones.

This commit sets up Alembic and adds a new `make-migration` command,
which will try to understand the model for a queue handler and generate
a migration script.

Relates to #4
bochecha added a commit that referenced this issue Dec 6, 2019
Queue handlers usually come with their data models. Up until now, the
only way to create them was through the initdb command, which only works
to create new models, but not to modify existing ones.

This commit adds a new `migratedb` command, which will find the
migrations of all configured queues and run them to upgrade the
database.

Relates to #4
bochecha added a commit that referenced this issue Dec 9, 2019
Queue handlers usually come with their data models. Up until now, the
only way to create them was through the initdb command, which only works
to create new models, but not to modify existing ones.

This commit sets up Alembic and adds a new `make-migration` command,
which will try to understand the model for a queue handler and generate
a migration script.

Relates to #4
bochecha added a commit that referenced this issue Dec 9, 2019
Queue handlers usually come with their data models. Up until now, the
only way to create them was through the initdb command, which only works
to create new models, but not to modify existing ones.

This commit adds a new `migratedb` command, which will find the
migrations of all configured queues and run them to upgrade the
database.

Relates to #4
bochecha added a commit that referenced this issue Dec 9, 2019
Queue handlers usually come with their data models. Up until now, the
only way to create them was through the initdb command, which only works
to create new models, but not to modify existing ones.

This commit sets up Alembic and adds a new `make-migration` command,
which will try to understand the model for a queue handler and generate
a migration script.

Relates to #4
bochecha added a commit that referenced this issue Dec 9, 2019
Queue handlers usually come with their data models. Up until now, the
only way to create them was through the initdb command, which only works
to create new models, but not to modify existing ones.

This commit adds a new `migratedb` command, which will find the
migrations of all configured queues and run them to upgrade the
database.

Relates to #4
@bochecha
Copy link
Contributor Author

bochecha commented Dec 9, 2019

This was fixed by #59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant