Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a "dontDrop" property in shared config to define tables not to be dropped #847

Closed
wants to merge 6 commits into from

Conversation

Julien-R44
Copy link
Member

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

@Julien-R44
Copy link
Member Author

Oh, also, I was wondering if there was any particular reason why the drop-tables.spec.ts test file was ignored?

files: ['test/**/*.spec.ts', '!test/database/drop-table.spec.ts'],

@thetutlage
Copy link
Member

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.

@stale
Copy link

stale bot commented Aug 11, 2022

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.

@stale stale bot added the Status: Abandoned Dropped and not into consideration label Aug 11, 2022
@stale stale bot closed this Sep 9, 2022
@Julien-R44 Julien-R44 reopened this Sep 9, 2022
@stale stale bot removed the Status: Abandoned Dropped and not into consideration label Sep 9, 2022
@Julien-R44
Copy link
Member Author

After discussing it, we just need to make it works with Sqlite and Mssql
I'm gonna try to look at this quickly

Julien-R44 added a commit that referenced this pull request Sep 17, 2022
@Julien-R44 Julien-R44 closed this Sep 17, 2022
@Julien-R44
Copy link
Member Author

I screwed up with git 😅 I'll open a new PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

db:fresh and db:wipe commands fail with PostGIS extension
2 participants