From 8ca89f72bff9aadb5b2eac554ef7cad88dc4217e Mon Sep 17 00:00:00 2001 From: Philippe Rolet Date: Mon, 13 Nov 2023 17:08:34 +0100 Subject: [PATCH] [Front] Cleaning: Remove plan column from workspace table (#2510) Related [task](https://github.com/dust-tt/tasks/issues/200) --- front/lib/models/workspace.ts | 5 ----- front/migrations/20230919_workspace_upgraded_at.ts | 2 ++ front/migrations/20231113_remove_plan_column.sql | 1 + 3 files changed, 3 insertions(+), 5 deletions(-) create mode 100644 front/migrations/20231113_remove_plan_column.sql diff --git a/front/lib/models/workspace.ts b/front/lib/models/workspace.ts index bb26deda6590..38dbc05de047 100644 --- a/front/lib/models/workspace.ts +++ b/front/lib/models/workspace.ts @@ -25,8 +25,6 @@ export class Workspace extends Model< declare name: string; declare description: string | null; declare allowedDomain: string | null; - declare plan: string | null; - declare subscriptions: NonAttribute; } Workspace.init( @@ -64,9 +62,6 @@ Workspace.init( allowedDomain: { type: DataTypes.STRING, }, - plan: { - type: DataTypes.STRING, - }, }, { modelName: "workspace", diff --git a/front/migrations/20230919_workspace_upgraded_at.ts b/front/migrations/20230919_workspace_upgraded_at.ts index 2be46bb0c7d0..dcea381e0825 100644 --- a/front/migrations/20230919_workspace_upgraded_at.ts +++ b/front/migrations/20230919_workspace_upgraded_at.ts @@ -4,8 +4,10 @@ import { Workspace } from "@app/lib/models"; async function main() { console.log("Fetching Upgraded Worspaces..."); + // @ts-expect-error no plan column anymore const workspaces = await Workspace.findAll({ where: { + // @ts-expect-error no plan column anymore plan: { [Op.not]: null, }, diff --git a/front/migrations/20231113_remove_plan_column.sql b/front/migrations/20231113_remove_plan_column.sql new file mode 100644 index 000000000000..a1d35444eda6 --- /dev/null +++ b/front/migrations/20231113_remove_plan_column.sql @@ -0,0 +1 @@ +ALTER TABLE "workspaces" DROP COLUMN "plan";