Skip to content

Conversation

@qwerty287
Copy link
Contributor

@qwerty287 qwerty287 commented Oct 25, 2023

Hi @techknowlogick!

I'm one of the Woodpecker maintainers and we have an open issue/discussion about moving our DB migration handling somewhere else/switch to this library (woodpecker-ci/woodpecker#2148).
However, our custom migrator has some features xormigrate does not have, so we can't switch to it currently.

One of these features is the possibility to skip migrations that will probably take a very long time to run (in our case logs migration). I added support for this to xormigrate in this PR.
If you don't want to extend this library, feel free to just close the PR.

Everything that was changed outside the xormigrate.go and xormigrate_test.go files was done by go mod tidy or go fmt, I can undo these changes if you want don't them.

@techknowlogick techknowlogick merged commit 5c78bfd into techknowlogick:main Oct 25, 2023
@techknowlogick
Copy link
Owner

Thanks! 🙏

@qwerty287 qwerty287 deleted the add-long branch October 26, 2023 07:14
Comment on lines +100 to +104
// InitSchema sets a function that is run if no migration is found.
// The idea is preventing to run all migrations when a new clean database
// is being migratinx. In this function you should create all tables and
// foreign key necessary to your application.
func (x *Xormigrate) AllowLong(allow ...bool) {
Copy link

Choose a reason for hiding this comment

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

Copied from InitSchema

@qwerty287 qwerty287 mentioned this pull request Nov 5, 2023
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.

3 participants