P
Prisma6mo ago
Null

Prisma Enum Mapping

I have this enum in my prisma.schema is there a way for me to map it the same way as I map in my schema?
enum CombatCategory {
TANK_MELEE @map("M1")
DODGE_MELEE @map("M2")
FULL_HYBRID @map("M3")
POWER_MELEE @map("M4")
OFFENSIVE_CASTER @map("C1")
DEFENSIVE_CASTER @map("C2")
POWER_CASTER @map("C3")
LUCK_HYBRID @map("S1")
}
enum CombatCategory {
TANK_MELEE @map("M1")
DODGE_MELEE @map("M2")
FULL_HYBRID @map("M3")
POWER_MELEE @map("M4")
OFFENSIVE_CASTER @map("C1")
DEFENSIVE_CASTER @map("C2")
POWER_CASTER @map("C3")
LUCK_HYBRID @map("S1")
}
Currently it outputs to this:
export const CombatCategory: {
TANK_MELEE: 'TANK_MELEE',
DODGE_MELEE: 'DODGE_MELEE',
FULL_HYBRID: 'FULL_HYBRID',
POWER_MELEE: 'POWER_MELEE',
OFFENSIVE_CASTER: 'OFFENSIVE_CASTER',
DEFENSIVE_CASTER: 'DEFENSIVE_CASTER',
POWER_CASTER: 'POWER_CASTER',
LUCK_HYBRID: 'LUCK_HYBRID'
};

export type CombatCategory = (typeof CombatCategory)[keyof typeof CombatCategory]
export const CombatCategory: {
TANK_MELEE: 'TANK_MELEE',
DODGE_MELEE: 'DODGE_MELEE',
FULL_HYBRID: 'FULL_HYBRID',
POWER_MELEE: 'POWER_MELEE',
OFFENSIVE_CASTER: 'OFFENSIVE_CASTER',
DEFENSIVE_CASTER: 'DEFENSIVE_CASTER',
POWER_CASTER: 'POWER_CASTER',
LUCK_HYBRID: 'LUCK_HYBRID'
};

export type CombatCategory = (typeof CombatCategory)[keyof typeof CombatCategory]
I am Expecting it to be:
export const CombatCategory: {
TANK_MELEE: 'M1',
DODGE_MELEE: 'M2',
FULL_HYBRID: 'M3',
POWER_MELEE: 'M4',
OFFENSIVE_CASTER: 'C1',
DEFENSIVE_CASTER: 'C2',
POWER_CASTER: 'C3',
LUCK_HYBRID: 'S1'
};

export type CombatCategory = (typeof CombatCategory)[keyof typeof CombatCategory]
export const CombatCategory: {
TANK_MELEE: 'M1',
DODGE_MELEE: 'M2',
FULL_HYBRID: 'M3',
POWER_MELEE: 'M4',
OFFENSIVE_CASTER: 'C1',
DEFENSIVE_CASTER: 'C2',
POWER_CASTER: 'C3',
LUCK_HYBRID: 'S1'
};

export type CombatCategory = (typeof CombatCategory)[keyof typeof CombatCategory]
No description
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server