소스 검색

feat: Installs citext extension in migration

Owen Diffey 1 주 전
부모
커밋
004fb1e127
1개의 변경된 파일18개의 추가작업 그리고 0개의 파일을 삭제
  1. 18 0
      backend/src/modules/DataModule/migrations/1725485640-create-citext-extension.ts

+ 18 - 0
backend/src/modules/DataModule/migrations/1725485640-create-citext-extension.ts

@@ -0,0 +1,18 @@
+import { Sequelize, DataTypes } from "sequelize";
+import { MigrationParams } from "umzug";
+
+export const up = async ({
+	context: sequelize
+}: MigrationParams<Sequelize>) => {
+	await sequelize.query(
+		"CREATE EXTENSION citext"
+	);
+};
+
+export const down = async ({
+	context: sequelize
+}: MigrationParams<Sequelize>) => {
+	await sequelize.query(
+		"DROP EXTENSION citext"
+	);
+};