Skip to content

Commit e59e252

Browse files
create migration file to delete bad seeded user data
1 parent 3762776 commit e59e252

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Op } from "sequelize";
2+
import { Migration } from "../umzug";
3+
4+
export const up: Migration = async ({ context: sequelize }) => {
5+
await sequelize.getQueryInterface().bulkDelete("applicationdashboardtable", {
6+
reviewerId: { [Op.in]: [1, 2] },
7+
});
8+
await sequelize.getQueryInterface().bulkDelete("admins", {
9+
userId: { [Op.in]: [1, 2] },
10+
});
11+
await sequelize.getQueryInterface().bulkDelete("users", {
12+
id: { [Op.in]: [1, 2] },
13+
});
14+
};
15+
16+
export const down: Migration = async ({ context: sequelize }) => {
17+
// No down migration needed as this is a cleanup operation
18+
};

0 commit comments

Comments
 (0)