Skip to content

Commit

Permalink
[connectors] Update Zendesk data model (#8850)
Browse files Browse the repository at this point in the history
* 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

* 🚩 add migration script

* Revert "fix: remove unused columns groupId, assigneeId and organizationId"

This reverts commit d068f67.

* 🚩 update the migration script without the drop
  • Loading branch information
aubin-tchoi authored Nov 22, 2024
1 parent 568cb2f commit 44f3f72
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions connectors/migrations/db/migration_37.sql
Original file line number Diff line number Diff line change
@@ -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;
12 changes: 6 additions & 6 deletions connectors/src/lib/models/zendesk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ ZendeskBrand.init(
allowNull: false,
},
url: {
type: DataTypes.STRING,
type: DataTypes.TEXT,
allowNull: false,
},
subdomain: {
Expand Down Expand Up @@ -257,15 +257,15 @@ ZendeskCategory.init(
validate: { throwOnUnsafeInteger },
},
name: {
type: DataTypes.STRING,
type: DataTypes.TEXT,
allowNull: false,
},
description: {
type: DataTypes.TEXT,
allowNull: true,
},
url: {
type: DataTypes.STRING,
type: DataTypes.TEXT,
allowNull: false,
},
permission: {
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -428,7 +428,7 @@ ZendeskTicket.init(
defaultValue: DataTypes.NOW,
},
url: {
type: DataTypes.STRING,
type: DataTypes.TEXT,
allowNull: false,
},
subject: {
Expand Down

0 comments on commit 44f3f72

Please sign in to comment.