3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 20:35:02 +00:00

Store supporters in the database

This commit is contained in:
Dragory 2020-05-28 01:29:51 +03:00
parent cb4beacf8a
commit f9568ab37b
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
4 changed files with 89 additions and 17 deletions

View file

@ -0,0 +1,16 @@
import { BaseRepository } from "./BaseRepository";
import { getRepository, Repository } from "typeorm";
import { Supporter } from "./entities/Supporter";
export class Supporters extends BaseRepository {
private supporters: Repository<Supporter>;
constructor() {
super();
this.supporters = getRepository(Supporter);
}
getAll() {
return this.supporters.find();
}
}

View file

@ -0,0 +1,14 @@
import { Entity, Column, PrimaryColumn } from "typeorm";
@Entity("supporters")
export class Supporter {
@Column()
@PrimaryColumn()
user_id: string;
@Column()
name: string;
@Column()
amount: string | null;
}