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

database migrations #153

Merged
merged 7 commits into from
May 31, 2021
Merged

database migrations #153

merged 7 commits into from
May 31, 2021

Conversation

epoberezkin
Copy link
Member

No description provided.

@spaced4ndy
Copy link
Collaborator

not a fan of these up and down migrations due to many reasons:

  • have to write two way migrations - writing migrations becomes 2x more prone to error
  • migration down deletes from migrations table
  • more complex implementation of migration logic
  • data is not being migrated down anyway (neither it does up, but this we'd have to support)

I think we should use migrations as a tool for us to upgrade schema one way, rather than for a user to allow having non matching versions of database and application (who'd want it anyway?) - when the mismatch happens due to application version upgrade the application would then read append only migration table and based on the new migrations it has play them out. List of migrations doesn't have to be duplicated in the code, but built from the files in migrations folder. The first migration would be creation of the migrations table

@epoberezkin
Copy link
Member Author

removed down migrations

neither it does up, but this we'd have to support

up migrations have to migrate data, not only schema.

Copy link
Collaborator

@spaced4ndy spaced4ndy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

The only thing I question is exposing Migrations.app - this doesn't seem to have any benefit, we could just "call" app directly inside get w/t parameterizing it.

@epoberezkin epoberezkin merged commit 84ce001 into master May 31, 2021
@epoberezkin epoberezkin deleted the ep/migrations branch May 31, 2021 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants