Hello,
I am working with a small team to use Strapi as our API for development on a project. One of the things I’m used to with other frameworks is the ability to control changes to the database.
It seems to me a completely missing feature of Strapi to not have any control over generating schema files, creating a fresh database from a given codebase, and then filling this database with seed data. This is all well and good for local development, but this becomes problematic when you deploy new code attached to a database schema created by old code.
The main thing I’ve been struggling to find is a tool that will let me dump the schema of the database that Strapi generates. This would allow me to check something into the repo that could be run during local setup / build processes.
Can anybody shine a light on how these things are handled in active development or production?
Right now we are in development so it’s ok to plan to backup a local dev db, pull down latest changes to our strapi codebase on the server, and then restore the local DB the server to ensure correct structure. I would prefer to just run a command that told strapi to update it’s database after I pulled the latest code down.
An additional fold to this is usually seeding comes after migration… any ideas on how teams are handling seeding and migration would be greatly appreciated.
My dream scenario would be some sort of CLI tool that allowed you to create knex migrations from existing database schema. That would totally solve my problem… but it doesn’t exist. If I want to use knex migration tools with strapi, unless I’m missing something I’d have to manually create schema files and also manually keep track of any DB changes strapi makes and know to make new migration files any time a model has changed.
Working with strapi so far has been AMAZING but this is the first real issue I haven’t been able to find a solution to in the docs or on stackoverflow