feat: add a "dontDrop" property in shared config to define tables not to be dropped
Fix #820
Hey 👋
So I just added a dontDrop property in the SharedConfigNode interface, which allows users to give a list of table names not to be dropped when the dropAllTables function is called. As a reminder, this function is also called when doing a db:wipe, or a db:fresh
When used on Postgres and Redshift, the default value of dontDrop is spatial_ref_sys, which is the table created and used by the commonly used PostGIS extension
I added this feature on Redshift, Mysql, and Postgres
Oh, also, I was wondering if there was any particular reason why the drop-tables.spec.ts test file was ignored?
https://github.com/adonisjs/lucid/blob/27381c4dabf797164359ed6bdfe17d54fdb2f086/bin/test.ts#L24
Ahh sorry for sitting on it for that long.
For some reasons keeping a command specific config within the database connection config seems bit off to me.
I like how rails do it. ActiveRecord::SchemaDumper.ignore_tables.
Can we introduce another property called wipe within the config object. Something like the following.
{
wipe: {
ignoreTables: ['']
}
}
Also, I remember correctly the internal classes of migration and seeder do not read config from the user config, its the commands that reads that config and passes a subset of it to the internal classes.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
After discussing it, we just need to make it works with Sqlite and Mssql I'm gonna try to look at this quickly
I screwed up with git 😅 I'll open a new PR