From 44f3f7249615ab7a3692c73c6ed5d3bf3bae78bc Mon Sep 17 00:00:00 2001 From: Aubin <60398825+aubin-tchoi@users.noreply.github.com> Date: Fri, 22 Nov 2024 16:29:50 +0100 Subject: [PATCH] [connectors] Update Zendesk data model (#8850) * fix: update the type of url in db to handle long ones * fix: remove unused columns groupId, assigneeId and organizationId * fix: update the type of Category's and Article's name to TEXT * :triangular_flag_on_post: add migration script * Revert "fix: remove unused columns groupId, assigneeId and organizationId" This reverts commit d068f675b9dcd9451b56fae3c88f236a490991df. * :triangular_flag_on_post: update the migration script without the drop --- connectors/migrations/db/migration_37.sql | 7 +++++++ connectors/src/lib/models/zendesk.ts | 12 ++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 connectors/migrations/db/migration_37.sql diff --git a/connectors/migrations/db/migration_37.sql b/connectors/migrations/db/migration_37.sql new file mode 100644 index 000000000000..50e6daf09168 --- /dev/null +++ b/connectors/migrations/db/migration_37.sql @@ -0,0 +1,7 @@ +-- Migration created on Nov 22, 2024 +ALTER TABLE "zendesk_brands" ALTER COLUMN "url" TYPE TEXT; +ALTER TABLE "zendesk_categories" ALTER COLUMN "name" TYPE TEXT; +ALTER TABLE "zendesk_categories" ALTER COLUMN "url" TYPE TEXT; +ALTER TABLE "zendesk_articles" ALTER COLUMN "name" TYPE TEXT; +ALTER TABLE "zendesk_articles" ALTER COLUMN "url" TYPE TEXT; +ALTER TABLE "zendesk_tickets" ALTER COLUMN "url" TYPE TEXT; diff --git a/connectors/src/lib/models/zendesk.ts b/connectors/src/lib/models/zendesk.ts index 384c34dedb21..1752ead95043 100644 --- a/connectors/src/lib/models/zendesk.ts +++ b/connectors/src/lib/models/zendesk.ts @@ -165,7 +165,7 @@ ZendeskBrand.init( allowNull: false, }, url: { - type: DataTypes.STRING, + type: DataTypes.TEXT, allowNull: false, }, subdomain: { @@ -257,7 +257,7 @@ ZendeskCategory.init( validate: { throwOnUnsafeInteger }, }, name: { - type: DataTypes.STRING, + type: DataTypes.TEXT, allowNull: false, }, description: { @@ -265,7 +265,7 @@ ZendeskCategory.init( allowNull: true, }, url: { - type: DataTypes.STRING, + type: DataTypes.TEXT, allowNull: false, }, permission: { @@ -350,11 +350,11 @@ ZendeskArticle.init( validate: { throwOnUnsafeInteger }, }, name: { - type: DataTypes.STRING, + type: DataTypes.TEXT, allowNull: false, }, url: { - type: DataTypes.STRING, + type: DataTypes.TEXT, allowNull: false, }, permission: { @@ -428,7 +428,7 @@ ZendeskTicket.init( defaultValue: DataTypes.NOW, }, url: { - type: DataTypes.STRING, + type: DataTypes.TEXT, allowNull: false, }, subject: {