-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix issue with long credential type names (#2961)
* 🐛 Fix issue when saving long credential's types The column type in the entity credentials was varchar(33) but nodes like Google Cloud Natural Language exceed the type length. The issue in only found when using Postgres. Mysql works fine as the column type has the proper length. Probably a migration at some point did not property update the column. https://community.n8n.io/t/google-cloud-natural-language-credentials-error-too-long-value/12003/4 * 👕 Fix lint issue * ⚡ Improvement
- Loading branch information
1 parent
2d8ac4b
commit 535dfe0
Showing
4 changed files
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/cli/src/databases/postgresdb/migrations/1646834195327-IncreaseTypeVarcharLimit.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { | ||
MigrationInterface, | ||
QueryRunner, | ||
} from 'typeorm'; | ||
|
||
import config = require('../../../../config'); | ||
|
||
export class IncreaseTypeVarcharLimit1646834195327 implements MigrationInterface { | ||
name = 'IncreaseTypeVarcharLimit1646834195327'; | ||
|
||
async up(queryRunner: QueryRunner): Promise<void> { | ||
const tablePrefix = config.get('database.tablePrefix'); | ||
await queryRunner.query(`ALTER TABLE ${tablePrefix}credentials_entity ALTER COLUMN "type" TYPE VARCHAR(128)`); | ||
} | ||
|
||
async down(queryRunner: QueryRunner): Promise<void> {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters