-
Hi, i am back! What i want is, to check/run migration when the app is running, instead of use lucky binary. Then, i add following code into the last line of a new 1.1.0 project's config/database.cr
I found those code never work, because
Maybe because I haven't used the Lucky/avram for a while now, but, i remember when i start o use avram with kemal, i can achieve this. I guess, maybe i missing some config which search migrations file in Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Okay, add a So, is there possible to create a precompile binary, like Thanks. |
Beta Was this translation helpful? Give feedback.
-
Hi, i know the reason i have to add because the require order in the
Is there special reason we can't write the "require ../db/migrations/* *" earlier? just before the Or, just like how I have to manually modify every time, add it into require "../config/database.cr"? + require "../db/migrations/**"
# ...
+ if !LuckyEnv.task?
+ Avram::Migrator::Runner.new.run_pending_migrations
+ end |
Beta Was this translation helpful? Give feedback.
-
Yes, i thought this is the key point. migration is related to database, add it into config/database.cr is better? Or, if anyone use avaram without lucky, where the Thanks |
Beta Was this translation helpful? Give feedback.
Okay, add a
require "../db/migrations/**"
intoconfig/database.cr
do the trick.So, is there possible to create a precompile binary, like
bin/lucky.db.migrate
?Thanks.