https://dagster.io/ logo
#dagster-support
Title
# dagster-support
d

David Ankin

09/21/2022, 12:26 AM
does dagster have startup hooks/init hooks? for running database migrations and such? (i guess that would just go in the repository function?)
c

chris

10/19/2022, 8:23 PM
sorry for the late reply! We don't have a concept of init hooks upon spinning up a dagster deployment, for example, if that's what you mean
d

David Ankin

10/21/2022, 8:52 PM
I am putting database migrations in the repository function, was wondering if there is a better place for that - well our team is, I don't program in python
c

chris

10/21/2022, 8:54 PM
It might be nice to have an actual job that performs the database migration, and trigger it via a sensor, so that you had an actual track of when the migration was performed. Would also allow you to manually trigger said migration when necessary.
👍 1
d

David Ankin

10/21/2022, 8:59 PM
I'm not sure what would be most idiomatic, but if there were like "lifecycle" triggers, for example, like spring's ApplicationContextStartedEvent or something. that is my reference point. in spring, you get start, refresh, then stop, then closed, iirc. but a lot of stuff is just simply handled through the bean framework. you can register yourself as a bean which depends on other thing, or register beans of a type which other things depend on, and establish a startup order like... run my migration first, then create the dagster ops/jobs/etc