Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions migrations/20260806000000-deprecate-announcements.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
export const up = async (db) => {
await db.collection('announcements').drop();
};

export const down = async (db) => {
await db.createCollection('announcements', {
validator: {
$jsonSchema: {
bsonType: 'object',
title: 'Announcements Object Validation',
required: ['title', 'description', 'time'],
properties: {
_id: {
bsonType: 'objectId',
description: '_id must be an ObjectId',
},
title: {
bsonType: 'string',
description: 'title must be a string',
},
description: {
bsonType: 'string',
description: 'description must be a string',
},
time: {
bsonType: 'date',
description: 'time must be a date.',
},
},
additionalProperties: false,
},
},
});
};
Loading