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:
|
||||
paths:
|
||||
- packages/cli/src/databases/**
|
||||
- packages/@n8n/db/**
|
||||
- packages/cli/src/modules/*/database/**
|
||||
- packages/cli/test/integration/**
|
||||
- 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:
|
||||
// This migration should work the same even if we refactor the function in
|
||||
// `User.ts`.
|
||||
|
||||
@@ -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'.
|
||||
|
||||
@@ -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' });
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user