feat(database): refactor entities and relationships for service management

This commit is contained in:
2025-11-26 10:57:57 +01:00
parent 104023162a
commit 55e4cf3e6c
9 changed files with 110 additions and 213 deletions

View File

@@ -1,4 +1,5 @@
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
import { Service } from "./service.entity";
@Entity({name: 'follows'})
export class Follow {
@@ -8,8 +9,12 @@ export class Follow {
@Column()
user_discord: string;
@ManyToOne(() => Service, service => service.follows)
@JoinColumn({name: 'serviceId'})
service: Service;
@Column()
host: string;
serviceId: number;
@Column({default: false})
enable: boolean;