feat(guild-model): add member and role base entities
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
@Entity('guild_member_roles')
|
||||
export class GuildMemberRole {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id!: string;
|
||||
|
||||
@Column({ type: 'char', length: 36 })
|
||||
guildId!: string;
|
||||
|
||||
@Column({ type: 'char', length: 36 })
|
||||
memberId!: string;
|
||||
|
||||
@Column({ type: 'char', length: 36 })
|
||||
roleId!: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt!: Date;
|
||||
}
|
||||
19
Fabric.Backend.Guild/src/entities/guild-member.entity.ts
Normal file
19
Fabric.Backend.Guild/src/entities/guild-member.entity.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
@Entity('guild_members')
|
||||
export class GuildMember {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id!: string;
|
||||
|
||||
@Column({ type: 'char', length: 36 })
|
||||
guildId!: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 64 })
|
||||
userId!: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 16, default: 'active' })
|
||||
status!: 'active' | 'left' | 'blocked';
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt!: Date;
|
||||
}
|
||||
22
Fabric.Backend.Guild/src/entities/guild-role.entity.ts
Normal file
22
Fabric.Backend.Guild/src/entities/guild-role.entity.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
@Entity('guild_roles')
|
||||
export class GuildRole {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id!: string;
|
||||
|
||||
@Column({ type: 'char', length: 36 })
|
||||
guildId!: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 64 })
|
||||
code!: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 120 })
|
||||
name!: string;
|
||||
|
||||
@Column({ type: 'boolean', default: false })
|
||||
isSystem!: boolean;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt!: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user