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

Broken DeleteExecutionsWithWorkflows migration #5212

Closed
ifokeev opened this issue Jan 21, 2023 · 6 comments
Closed

Broken DeleteExecutionsWithWorkflows migration #5212

ifokeev opened this issue Jan 21, 2023 · 6 comments

Comments

@ifokeev
Copy link

ifokeev commented Jan 21, 2023

Bug not fixed, so reopen the issue.
Same situation as described in #5183 while migrating to 0.212.0 from 0.210.0.

Screen Shot 2023-01-21 at 10 51 52

After checking the codebase, it looks like DB_POSTGRESDB_SCHEMA

env: 'DB_POSTGRESDB_SCHEMA',
is not used anymore?

I'm using a specified schema for n8n, but I don't see that migrations are executed in this scope.

All new migrations are not specifying the schema as here:

const schema = config.getEnv('database.postgresdb.schema');
if (schema) {
tablePrefix = schema + '.' + tablePrefix;
}

For example:
https://github.com/n8n-io/n8n/blob/master/packages/cli/src/databases/migrations/postgresdb/1673268682475-DeleteExecutionsWithWorkflows.ts

I see there is a function getTablePrefix, but it's not used everywhere:

It looks like all new migrations should use this function

Environment:

  • n8n Version 0.210.0
@Joffcom
Copy link
Member

Joffcom commented Jan 21, 2023

Hey @ifokeev

Thanks for reporting this one, will get a fix in place shortly for the next release.

@krynble
Copy link
Contributor

krynble commented Jan 23, 2023

We plan on releasing a hotfix today, the fix can be seen here: #5218

@ifokeev
Copy link
Author

ifokeev commented Jan 23, 2023

Hi @krynble!
Thanks for the fix, but the same code

 const tablePrefix = getTablePrefix(); 

should be in every migration, not only in this one

@krynble
Copy link
Contributor

krynble commented Jan 23, 2023

Good point @ifokeev, added the others too.

@Joffcom Joffcom added the Upcoming Release Will be part of the upcoming release label Jan 23, 2023
@janober
Copy link
Member

janober commented Jan 23, 2023

Fix got released with [email protected]

@janober janober removed the Upcoming Release Will be part of the upcoming release label Jan 23, 2023
@Joffcom
Copy link
Member

Joffcom commented Jan 24, 2023

Hey @ifokeev,

As this is resolved I am going to close this issue, We will also be updating all of the older migrations to use the newer approach to keep things consistent.

Thanks again for reporting this.

@Joffcom Joffcom closed this as completed Jan 24, 2023
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

No branches or pull requests

4 participants