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

DB migration - Solution #3 #1057

Closed
Startrekzky opened this issue Jan 11, 2022 · 2 comments
Closed

DB migration - Solution #3 #1057

Startrekzky opened this issue Jan 11, 2022 · 2 comments
Assignees
Labels
priority/high This issue is very important type/feature-request This issue is a proposal for something new

Comments

@Startrekzky
Copy link
Contributor

To be added

@Startrekzky Startrekzky added the type/feature-request This issue is a proposal for something new label Jan 11, 2022
@klesh klesh added this to the v0.10.0 milestone Mar 3, 2022
@klesh klesh added the priority/high This issue is very important label Mar 3, 2022
@klesh
Copy link
Contributor

klesh commented Mar 3, 2022

The priority of this issue has been brought up, due to ee is planning to release with DevLake on next iteration.
@Startrekzky

@klesh
Copy link
Contributor

klesh commented Mar 3, 2022

Based on previous discussion, most of us tend to the following solution:

Solution #3: implement go-migrate functionality by using gorm.Migrator without go.AutoMigrate

How it works

has a migration_history that records all executed scripts

  1. Write migration scripts in Golang
  2. Register them all to framework
  3. Framework executes unexecuted scripts one by one

Pros

  1. Easy to implement on Framework level
  2. Easy to understand

Cons

  1. It's very tedious to write every single migration script and error-prone, like missing tables/columns and typos... We have 67 tables now, and there are more to come.
  2. Migration script auto-generation becomes kind of mandatory in order to reduce error and work hours, but it's not an easy task.

@klesh klesh changed the title DB migration - Phase 2 DB migration - Solution #3 Mar 3, 2022
@mindlesscloud mindlesscloud mentioned this issue Apr 11, 2022
2 tasks
@klesh klesh closed this as completed Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/high This issue is very important type/feature-request This issue is a proposal for something new
Projects
None yet
Development

No branches or pull requests

3 participants