Naturally. It was more about being able to clone it in the new db manager and then have it ready to track changes, avoiding the need to jump into another tool etc.
But seeing the instructions George wrote, that's good enough for me for a while.
Naturally. It was more about being able to clone it in the new db manager and then have it ready to track changes, avoiding the need to jump into another tool etc.
But seeing the instructions George wrote, that's good enough for me for a while.
So what you mean is to import an existing schema into the db manager of your dev target, then let wappler handle the migration files as normally and when you chose to deploy to another target Wappler would handle the initial schema import plus all the successive migration files?
Well I don’t want to hijack someone else’s thread here
My two experiences/thoughts would be:
That’s my take on it.
Good points! I made a feature request for better tracking
Copying and pasting from the other topic.
When you say clone in 1 you mean to create an initial migration file right?
Wappler would read the schema of the db and create an initial knex migration file as a starting point.
In 2 it would be an import/export losing all migration files. Again it would read the schema and create an initial migration file of the current state of schema. Then you could apply that migration file in another target.
All in all, both scenarios could be handled by translating existing schemas into an initial migration file. Ultimately the end is to have a starting point that can be reproducible in another target and compatible with knex migrations.
I believe knex doesn’t have a tool for this like sequelize(but sequelize is an ORM). Although some ideas could be used extracted from this project.
An alternative could be to create an initial migration file and seed? Something in these terms?
exports.seed = function(knex, Promise) {
var sql = fs.readFileSync('.dump.sql').toString();
return knex.raw('DROP DATABASE test')
.then(() => knex.raw('CREATE DATABASE test'))
.then(() => knex.raw(sql))
};
Bump.
Since recently I had a few issues with the DB-Manager. The migration files in context of UUID-Fields and References did not work as intended and had to always be manually improved. This lead me to delete a lot of migration files, because I thought there would be a way to export the DB completely from within Wappler without the migration files.
It would be an great improvement (after the fixing the several issues of the current db manager) to be able to export an .sql file the same as in phpmyadmin, and import it on a new project or on a new system.
This is an old topic about database schema synchronization that is already implemented in Wappler.
If you have additional request please open a new topic