feat: add Dockerfiles and MySQL TypeORM wiring for center/guild backends
This commit is contained in:
20
Fabric.Backend.Guild/src/entities/channel.entity.ts
Normal file
20
Fabric.Backend.Guild/src/entities/channel.entity.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
@Entity('channels')
|
||||
export class Channel {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id!: string;
|
||||
|
||||
@Column()
|
||||
guildId!: string;
|
||||
|
||||
@Column()
|
||||
name!: string;
|
||||
|
||||
@Index()
|
||||
@Column({ default: 0 })
|
||||
lastSeq!: number;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt!: Date;
|
||||
}
|
||||
13
Fabric.Backend.Guild/src/entities/guild.entity.ts
Normal file
13
Fabric.Backend.Guild/src/entities/guild.entity.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
@Entity('guilds')
|
||||
export class Guild {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id!: string;
|
||||
|
||||
@Column()
|
||||
name!: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt!: Date;
|
||||
}
|
||||
21
Fabric.Backend.Guild/src/entities/message.entity.ts
Normal file
21
Fabric.Backend.Guild/src/entities/message.entity.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
@Entity('messages')
|
||||
@Index(['channelId', 'seq'], { unique: true })
|
||||
export class Message {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id!: string;
|
||||
|
||||
@Index()
|
||||
@Column()
|
||||
channelId!: string;
|
||||
|
||||
@Column()
|
||||
seq!: number;
|
||||
|
||||
@Column({ type: 'text' })
|
||||
content!: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt!: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user