ekatzenstein / create-react-app-fullstack

Use create-react-app as a full-stack tool, with Express and Sequelize (PostgreSQL)
MIT License
51 stars 13 forks source link

Docs on Sequelize DB Sync vs Migrations File structure #9

Closed chaseTfreeman closed 6 years ago

chaseTfreeman commented 6 years ago

I am new to working with sequelize but really like it so far and the docs are easy to follow. However, it seems that the common best practice these days is not to Sync databases in production in which case Migrations are better to start with from the beginning.

When I run sequelize init on the CLI tool, it generates new models, seeders, and migrations folders that are then tied in whenever I use migrations to create new tables, etc.

Do you have any way sources that could help me better understand how this new file structure could work with the boiler plate you've already developed? I'm thrown for a loop here because the DB syncs from the "db" directory and the models files, but then the migrations are working from a separate models file.

chaseTfreeman commented 6 years ago

Never-mind, I found what I needed here: http://gregtrowbridge.com/getting-started-with-sequelize-and-the-sequelize-cli/