In production mode, when lifting a Sails application, the database tables are not created upon lift, while in dev mode, they are. Right now, when deploying, I'm running in dev mode once first so that the tables can be created and then running in prod mode. Is there a way around this?
No; this is by design. In the production environment, Sails does not do any migration to ensure that data isn't corrupted or lost when lifting.
From the Sails deployment guide:
Sails sets all your models to
migrate:safe
when run in production, which means no auto-migrations are run on starting up the app. You can set your database up the following way: Create the database on the server and then run your sails app withmigrate:alter
locally, but configured to use the production server as your db. This will automatically set things up. In case you can't connect to the server remotely, you'll simply dump your local schema and import it into the database server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With