mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(core): Fix migrations on non-public Postgres schema (#3356)
* 🐛 Fix UM migration * ⚡ Account for schema in `search_path` * 🔥 Remove unneeded schema refs * 🧪 Account for alt schema in DB testing * ⚡ Add schema to `IncreaseTypeVarcharLimit` * ⚡ Set `search_path` in every migration * ⚡ Set `search_path` in down migrations
This commit is contained in:
@@ -24,7 +24,7 @@ import { issueJWT } from '../../../src/UserManagement/auth/jwt';
|
||||
import { getLogger } from '../../../src/Logger';
|
||||
import { credentialsController } from '../../../src/api/credentials.api';
|
||||
import type { User } from '../../../src/databases/entities/User';
|
||||
import type { EndpointGroup, SmtpTestAccount } from './types';
|
||||
import type { EndpointGroup, PostgresSchemaSection, SmtpTestAccount } from './types';
|
||||
import type { N8nApp } from '../../../src/UserManagement/Interfaces';
|
||||
import * as UserManagementMailer from '../../../src/UserManagement/email/UserManagementMailer';
|
||||
|
||||
@@ -262,3 +262,15 @@ export const categorize = <T>(arr: T[], test: (str: T) => boolean) => {
|
||||
{ pass: [], fail: [] },
|
||||
);
|
||||
};
|
||||
|
||||
export function getPostgresSchemaSection(
|
||||
schema = config.getSchema(),
|
||||
): PostgresSchemaSection | null {
|
||||
for (const [key, value] of Object.entries(schema)) {
|
||||
if (key === 'postgresdb') {
|
||||
return value._cvtProperties;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user