Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

migration with model #379

Closed
u007 opened this issue Apr 12, 2017 · 6 comments
Closed

migration with model #379

u007 opened this issue Apr 12, 2017 · 6 comments

Comments

@u007
Copy link
Member

u007 commented Apr 12, 2017

hi,

is it possible to run a model oriented migration like:

var users models.Users
pop.Q(tx).Where("id > 5").All(&users)
for i := range users {
  users[i].DoSomething()
}

or anyway to allow migration to import modules and use them?

@markbates
Copy link
Member

No. You execute pure sql in a migration though, if you want.

I would recommend using a grift task for this sort of thing.

@paganotoni
Copy link
Member

@markbates @u007 should we close this one ?

@u007
Copy link
Member Author

u007 commented Apr 13, 2017

any possible way to allow fizz to run a grift task?
sometimes there might be some migration value, then running a task, then continue with the rest of the migration in one fizz file

@markbates
Copy link
Member

Not currently, but it would be great to add support to fizz to allow it to run shell out and run a command. It would be pretty easy to add. If anyone wanted to do it, this would be the starting place: https://github.com/markbates/pop/blob/master/fizz%2Fbubbler.go ;)

@markbates
Copy link
Member

@u007 I believe this PR https://github.com/markbates/pop/pull/68 solves this issue for you.

@u007
Copy link
Member Author

u007 commented Apr 23, 2017

nice, thank you :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants