mirror of
https://github.com/muerwre/vk-tg-bot.git
synced 2025-04-25 06:56:40 +07:00
#4 added typeorm entities for likes and events
This commit is contained in:
parent
c0588acd26
commit
c5c3c013ba
5 changed files with 69 additions and 9 deletions
|
@ -1,6 +1,6 @@
|
|||
import { Storage } from "../index";
|
||||
import { VkEvent } from "../../vk/types";
|
||||
import { Event } from "../types";
|
||||
import { StoredEvent } from "../types";
|
||||
import { PostgresConfig } from "./types";
|
||||
import { Connection, createConnection } from "typeorm";
|
||||
|
||||
|
@ -12,6 +12,7 @@ export class PostgresDB implements Storage {
|
|||
this.connection = await createConnection({
|
||||
type: "postgres",
|
||||
url: this.config.uri,
|
||||
entities: ["./entities/*.ts"],
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -32,11 +33,12 @@ export class PostgresDB implements Storage {
|
|||
};
|
||||
};
|
||||
|
||||
createEvent = async (event: Event) => event;
|
||||
createEvent = async (event: StoredEvent) => event;
|
||||
|
||||
getLikesFor = async (channel: string, messageId: number) => [];
|
||||
|
||||
getLikeBy = async (channel: string, messageId: number, author: number) => ({
|
||||
id: 0,
|
||||
channel,
|
||||
messageId,
|
||||
author,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue