Fork me on GitHub
#luminus
<
2020-01-30
>
entropy19:01:45

Hello. I have a luminus app with a postgres db, and I'm using the default database migrations library. This works great on my development machine (where I run the migrations with lein and start the web server via the repl). However, I am deploying this app to a wildfly instance (using lein immutant war), and I am at a loss as to how to run the migrations in production. I have ssh access to the machine running wildfly, and I can run jboss-cli, but I don't know what command to execute to run the migrations. The documentation at https://luminusweb.com/docs/deployment.html has a suggestion for Heroku to make 'run the migrations' part of app start-up, so I tried that. I can see from the logs that my app did indeed run a 'migrate' step, but it did not find any migrations to run! (I checked that the files under resources/migrations/ are indeed included in my .war file). Any help is appreciated!

bibiki23:01:13

have you tried this?

java -jar target/uberjar/<app>.jar migrate

bibiki23:01:20

another thing I just found out is that migrations creates a schema_migrations table in the database where it keeps track of migrations ran. for all I currently understand, for a migration file to be ran, its name must start with at least 1 digit AND that file name must not have been entered in the schema_migrations file. Hope this helps

entropy20:01:50

thanks for the info, that might be just what I need. I just need to figure out where on the server the .war is stored 😃

entropy20:01:30

I have noticed the schema_migrations table too... it's another way I know that none of my migrations have run in production

👍 4