mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 09:36:44 +00:00
chore(core): Update all refs from cli/src/databases to @n8n/db (#15708)
This commit is contained in:
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@@ -1 +1 @@
|
|||||||
packages/cli/src/databases/migrations/ @n8n-io/migrations-review
|
packages/@n8n/db/src/migrations/ @n8n-io/migrations-review
|
||||||
|
|||||||
1
.github/workflows/ci-postgres-mysql.yml
vendored
1
.github/workflows/ci-postgres-mysql.yml
vendored
@@ -7,6 +7,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- packages/cli/src/databases/**
|
- packages/cli/src/databases/**
|
||||||
|
- packages/@n8n/db/**
|
||||||
- packages/cli/src/modules/*/database/**
|
- packages/cli/src/modules/*/database/**
|
||||||
- packages/cli/test/integration/**
|
- packages/cli/test/integration/**
|
||||||
- packages/cli/test/shared/db/**
|
- packages/cli/test/shared/db/**
|
||||||
|
|||||||
@@ -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:
|
// Reason:
|
||||||
// This migration should work the same even if we refactor the function in
|
// This migration should work the same even if we refactor the function in
|
||||||
// `User.ts`.
|
// `User.ts`.
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export class UserRepository extends Repository<User> {
|
|||||||
* @deprecated Use `UserRepository.save` instead if you can.
|
* @deprecated Use `UserRepository.save` instead if you can.
|
||||||
*
|
*
|
||||||
* We need to use `save` so that that the subscriber in
|
* 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`
|
* With `update` it would only receive the updated fields, e.g. the `id`
|
||||||
* would be missing. test('does not use `Repository.update`, but
|
* would be missing. test('does not use `Repository.update`, but
|
||||||
* `Repository.save` instead'.
|
* `Repository.save` instead'.
|
||||||
|
|||||||
@@ -484,21 +484,17 @@ module.exports = {
|
|||||||
meta: {
|
meta: {
|
||||||
type: 'error',
|
type: 'error',
|
||||||
docs: {
|
docs: {
|
||||||
description:
|
description: 'Ensure `@n8n/typeorm` is imported only from within the `@n8n/db` package.',
|
||||||
'Ensure `@n8n/typeorm` is imported only from within the `packages/cli/src/databases` directory.',
|
|
||||||
recommended: 'error',
|
recommended: 'error',
|
||||||
},
|
},
|
||||||
messages: {
|
messages: {
|
||||||
moveImport: 'Move this import to `packages/cli/src/databases/**/*.ts`.',
|
moveImport: 'Please move this import to `@n8n/db`.',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
create(context) {
|
create(context) {
|
||||||
return {
|
return {
|
||||||
ImportDeclaration(node) {
|
ImportDeclaration(node) {
|
||||||
if (
|
if (node.source.value === '@n8n/typeorm' && !context.getFilename().includes('@n8n/db')) {
|
||||||
node.source.value === '@n8n/typeorm' &&
|
|
||||||
!context.getFilename().includes('packages/cli/src/databases/')
|
|
||||||
) {
|
|
||||||
context.report({ node, messageId: 'moveImport' });
|
context.report({ node, messageId: 'moveImport' });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const userRepository = mockInstance(UserRepository);
|
|||||||
describe('Ldap/helpers', () => {
|
describe('Ldap/helpers', () => {
|
||||||
describe('updateLdapUserOnLocalDb', () => {
|
describe('updateLdapUserOnLocalDb', () => {
|
||||||
// We need to use `save` so that that the subscriber in
|
// 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`
|
// With `update` it would only receive the updated fields, e.g. the `id`
|
||||||
// would be missing.
|
// would be missing.
|
||||||
test('does not use `Repository.update`, but `Repository.save` instead', async () => {
|
test('does not use `Repository.update`, but `Repository.save` instead', async () => {
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ describe('UserService', () => {
|
|||||||
|
|
||||||
describe('update', () => {
|
describe('update', () => {
|
||||||
// We need to use `save` so that that the subscriber in
|
// 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`
|
// With `update` it would only receive the updated fields, e.g. the `id`
|
||||||
// would be missing.
|
// would be missing.
|
||||||
it('should use `save` instead of `update`', async () => {
|
it('should use `save` instead of `update`', async () => {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ mockInstance(AuthIdentityRepository);
|
|||||||
describe('sso/saml/samlHelpers', () => {
|
describe('sso/saml/samlHelpers', () => {
|
||||||
describe('updateUserFromSamlAttributes', () => {
|
describe('updateUserFromSamlAttributes', () => {
|
||||||
// We need to use `save` so that that the subscriber in
|
// 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`
|
// With `update` it would only receive the updated fields, e.g. the `id`
|
||||||
// would be missing.
|
// would be missing.
|
||||||
test('does not user `Repository.update`, but `Repository.save` instead', async () => {
|
test('does not user `Repository.update`, but `Repository.save` instead', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user