Code Monkey home page Code Monkey logo

Comments (3)

dgroch avatar dgroch commented on July 17, 2024

OK, so I think i might have this sorted!
First-time run of the app needed to be in development mode to create the database tables.

Here's the relevant Part of the docs

If you are using a relational database such as MySQL, there is an additional step. Remember how Sails sets all your models to migrate:safe when run in production? That means no auto-migrations are run when lifting the app...which means by default your tables won't exist. A common approach to deal with this during the first-time setup of a relational database for your Sails app goes as follows:

Create the database on the production database server (e.g. frenchfryparty)

Configure your app locally to use this production database, but don't set the environment to 'production', and leave your models' configuration set to migrate: 'alter'. Now run sails lift once-- and when the local server finishes lifting, kill it.

Be careful! You should only do this when there is no data in the production database.
If this makes you nervous or if you can't connect to the production database remotely, you can skip the steps above. Instead, simply dump your local schema and import it into the production database.

I lost hours on this one!

from dokku-mysql.

josegonzalez avatar josegonzalez commented on July 17, 2024

It would be great if you could make a pull request against our documentation - in the docs repo - in regards to this issue. Would help the next person not lose hours on this one :)

from dokku-mysql.

josegonzalez avatar josegonzalez commented on July 17, 2024

Thinking this through further, there is no reason to believe that dokku should make any claim as to what is in your database. It is wholly up to the developer to apply any database migrations, and noting down how each and every web framework deals with this problem is wayyyy outside the scope of what dokku does.

from dokku-mysql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.