mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-23 06:25:14 +00:00
wip
This commit is contained in:
parent
02be56cfc0
commit
65069d5fdb
3 changed files with 24 additions and 4 deletions
|
@ -4,13 +4,15 @@ import db from '../../db/mongodb';
|
|||
import Reaction from './post-reaction';
|
||||
import { pack as packUser } from './user';
|
||||
|
||||
const PostReaction = db.get<IPostReaction>('post_reactions');
|
||||
const PostReaction = db.get<IPostReaction>('postReactions');
|
||||
export default PostReaction;
|
||||
|
||||
export interface IPostReaction {
|
||||
_id: mongo.ObjectID;
|
||||
created_at: Date;
|
||||
deleted_at: Date;
|
||||
createdAt: Date;
|
||||
deletedAt: Date;
|
||||
postId: mongo.ObjectID;
|
||||
userId: mongo.ObjectID;
|
||||
reaction: string;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import db from '../../db/mongodb';
|
||||
|
||||
export default db.get('post_watching') as any; // fuck type definition
|
||||
const PostWatching = db.get<IPostWatching>('postWatching');
|
||||
export default PostWatching;
|
||||
|
||||
export interface IPostWatching {
|
||||
_id: mongo.ObjectID;
|
||||
createdAt: Date;
|
||||
userId: mongo.ObjectID;
|
||||
postId: mongo.ObjectID;
|
||||
}
|
||||
|
|
|
@ -147,3 +147,12 @@ db.pollVotes.update({}, {
|
|||
post_id: 'postId'
|
||||
}
|
||||
}, false, true);
|
||||
|
||||
db.post_reactions.renameCollection('postReactions');
|
||||
db.postReactions.update({}, {
|
||||
$rename: {
|
||||
created_at: 'createdAt',
|
||||
user_id: 'userId',
|
||||
post_id: 'postId'
|
||||
}
|
||||
}, false, true);
|
||||
|
|
Loading…
Reference in a new issue