chore(core): Update all refs from cli/src/databases to @n8n/db (#15708)

This commit is contained in:
Iván Ovejero
2025-05-27 11:41:27 +02:00
committed by GitHub
parent ca0b38d64e
commit 38137d8bc3
8 changed files with 10 additions and 13 deletions

2
.github/CODEOWNERS vendored
View File

@@ -1 +1 @@
packages/cli/src/databases/migrations/ @n8n-io/migrations-review
packages/@n8n/db/src/migrations/ @n8n-io/migrations-review

View File

@@ -7,6 +7,7 @@ on:
pull_request:
paths:
- packages/cli/src/databases/**
- packages/@n8n/db/**
- packages/cli/src/modules/*/database/**
- packages/cli/test/integration/**
- packages/cli/test/shared/db/**

View File

@@ -214,7 +214,7 @@ export class CreateProject1714133768519 implements ReversibleMigration {
);
}
// Duplicated from packages/cli/src/databases/entities/User.ts
// Duplicated from packages/@n8n/db/src/entities/User.ts
// Reason:
// This migration should work the same even if we refactor the function in
// `User.ts`.

View File

@@ -22,7 +22,7 @@ export class UserRepository extends Repository<User> {
* @deprecated Use `UserRepository.save` instead if you can.
*
* We need to use `save` so that that the subscriber in
* packages/cli/src/databases/entities/Project.ts receives the full user.
* packages/@n8n/db/src/entities/Project.ts receives the full user.
* With `update` it would only receive the updated fields, e.g. the `id`
* would be missing. test('does not use `Repository.update`, but
* `Repository.save` instead'.

View File

@@ -484,21 +484,17 @@ module.exports = {
meta: {
type: 'error',
docs: {
description:
'Ensure `@n8n/typeorm` is imported only from within the `packages/cli/src/databases` directory.',
description: 'Ensure `@n8n/typeorm` is imported only from within the `@n8n/db` package.',
recommended: 'error',
},
messages: {
moveImport: 'Move this import to `packages/cli/src/databases/**/*.ts`.',
moveImport: 'Please move this import to `@n8n/db`.',
},
},
create(context) {
return {
ImportDeclaration(node) {
if (
node.source.value === '@n8n/typeorm' &&
!context.getFilename().includes('packages/cli/src/databases/')
) {
if (node.source.value === '@n8n/typeorm' && !context.getFilename().includes('@n8n/db')) {
context.report({ node, messageId: 'moveImport' });
}
},

View File

@@ -11,7 +11,7 @@ const userRepository = mockInstance(UserRepository);
describe('Ldap/helpers', () => {
describe('updateLdapUserOnLocalDb', () => {
// We need to use `save` so that that the subscriber in
// packages/cli/src/databases/entities/Project.ts receives the full user.
// packages/@n8n/db/src/entities/Project.ts receives the full user.
// With `update` it would only receive the updated fields, e.g. the `id`
// would be missing.
test('does not use `Repository.update`, but `Repository.save` instead', async () => {

View File

@@ -80,7 +80,7 @@ describe('UserService', () => {
describe('update', () => {
// We need to use `save` so that that the subscriber in
// packages/cli/src/databases/entities/Project.ts receives the full user.
// packages/@n8n/db/src/entities/Project.ts receives the full user.
// With `update` it would only receive the updated fields, e.g. the `id`
// would be missing.
it('should use `save` instead of `update`', async () => {

View File

@@ -14,7 +14,7 @@ mockInstance(AuthIdentityRepository);
describe('sso/saml/samlHelpers', () => {
describe('updateUserFromSamlAttributes', () => {
// We need to use `save` so that that the subscriber in
// packages/cli/src/databases/entities/Project.ts receives the full user.
// packages/@n8n/db/src/entities/Project.ts receives the full user.
// With `update` it would only receive the updated fields, e.g. the `id`
// would be missing.
test('does not user `Repository.update`, but `Repository.save` instead', async () => {