diff --git a/.github/workflows/migration-order.yml b/.github/workflows/migration-order.yml index afff15ca718..86dcadf42af 100644 --- a/.github/workflows/migration-order.yml +++ b/.github/workflows/migration-order.yml @@ -25,6 +25,7 @@ jobs: uses: tj-actions/changed-files@v41 with: files: packages/server/postgres/migrations/*.ts + output_renamed_files_as_deleted_and_added: "true" - name: Check migration conflicts run: | diff --git a/packages/server/postgres/migrations/2024-10-24T22:26:35.877Z_integrationProviderUrls.ts b/packages/server/postgres/migrations/2024-10-24T22:26:35.877Z_integrationProviderUrls.ts deleted file mode 100644 index 94a99109905..00000000000 --- a/packages/server/postgres/migrations/2024-10-24T22:26:35.877Z_integrationProviderUrls.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type {Kysely} from 'kysely' - -export async function up(db: Kysely): Promise { - await db.schema - .alterTable('IntegrationProvider') - .alterColumn('webhookUrl', (ac) => ac.setDataType('varchar(2056)')) - .alterColumn('serverBaseUrl', (ac) => ac.setDataType('varchar(2056)')) - .execute() -} - -export async function down(db: Kysely): Promise {} diff --git a/packages/server/postgres/migrations/2024-10-25T17:36:31.231Z_indexDiscussionTopicId.ts b/packages/server/postgres/migrations/2024-10-25T17:36:31.231Z_indexDiscussionTopicId.ts deleted file mode 100644 index e97ab8562cd..00000000000 --- a/packages/server/postgres/migrations/2024-10-25T17:36:31.231Z_indexDiscussionTopicId.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type {Kysely} from 'kysely' - -export async function up(db: Kysely): Promise { - await db.schema - .createIndex('idx_Discussion_discussionTopicId') - .ifNotExists() - .on('Discussion') - .column('discussionTopicId') - .execute() -} - -export async function down(db: Kysely): Promise { - await db.schema.dropIndex('idx_Discussion_discussionTopicId').ifExists().execute() -} diff --git a/packages/server/postgres/migrations/2024-10-31T14:42:16.120Z_add-use-ai-to-orgs.ts b/packages/server/postgres/migrations/2024-10-31T14:42:16.120Z_name_changes.ts similarity index 100% rename from packages/server/postgres/migrations/2024-10-31T14:42:16.120Z_add-use-ai-to-orgs.ts rename to packages/server/postgres/migrations/2024-10-31T14:42:16.120Z_name_changes.ts diff --git a/packages/server/postgres/migrations/2024-11_26T15:49:33.276Z_new_migration.ts b/packages/server/postgres/migrations/2024-11_26T15:49:33.276Z_new_migration.ts new file mode 100644 index 00000000000..7c615d4e587 --- /dev/null +++ b/packages/server/postgres/migrations/2024-11_26T15:49:33.276Z_new_migration.ts @@ -0,0 +1,53 @@ +import {Kysely} from 'kysely' + +export async function up(db: Kysely): Promise { + await db + .insertInto('FeatureFlag') + .values([ + { + featureName: 'insights', + description: 'Whether the team has access to an AI summary of their wins and challenges', + expiresAt: new Date('2025-01-31T00:00:00.000Z'), + scope: 'Team' + }, + { + featureName: 'publicTeams', + description: 'Whether users can see teams they are not a member of in an org', + expiresAt: new Date('2025-01-31T00:00:00.000Z'), + scope: 'Organization' + }, + { + featureName: 'relatedDiscussions', + description: + 'A comment in a retro discussion thread that uses AI to show similar conversations in the past', + expiresAt: new Date('2025-01-31T00:00:00.000Z'), + scope: 'Organization' + }, + { + featureName: 'standupAISummary', + description: 'Whether the standup UI has an AI meeting Summary or not', + expiresAt: new Date('2025-01-31T00:00:00.000Z'), + scope: 'Organization' + }, + { + featureName: 'suggestGroups', + description: 'Auto-group reflections using AI', + expiresAt: new Date('2025-01-31T00:00:00.000Z'), + scope: 'Organization' + } + ]) + .execute() +} + +export async function down(db: Kysely): Promise { + await db + .deleteFrom('FeatureFlag') + .where('featureName', 'in', [ + 'insights', + 'publicTeams', + 'relatedDiscussions', + 'standupAISummary', + 'suggestGroups' + ]) + .execute() +}