How to create an enum type that is common across different tables? #16417
Answered
by
ephys
ckvv
asked this question in
Help & Questions
-
By default, sequelize @Table(defaultTableConfig)
export class User1 extends Model<
InferAttributes<User1>,
InferCreationAttributes<User1>
> {
@Attribute(DataTypes.INTEGER)
@PrimaryKey
@AutoIncrement
declare id: number;
@Attribute(DataTypes.ENUM('male', 'female'))
declare gender?: string; // enum
}
@Table(defaultTableConfig)
export class User2 extends Model<
InferAttributes<User2>,
InferCreationAttributes<User2>
> {
@Attribute(DataTypes.INTEGER)
@PrimaryKey
@AutoIncrement
declare id: number;
@Attribute(DataTypes.ENUM('male', 'female'))
declare gender?: string; // enum
} |
Beta Was this translation helpful? Give feedback.
Answered by
ephys
Dec 13, 2023
Replies: 1 comment
-
This is not currently supported: #2577 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ephys
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is not currently supported: #2577