zoraj
1
My dbml
Table t_hotel_chambre {
id int [pk, increment]
numero_chambre varchar(45)[not null, unique]
etat_chambre enum(‘DIRTY’,‘BUSY’,‘CLEAN’, ‘OUT’) [not null]
}
The export
CREATE TABLE t_hotel_chambre
(
id
int PRIMARY KEY AUTO_INCREMENT,
numero_chambre
varchar(45) UNIQUE NOT NULL,
etat_chambre
enum NOT NULL,
);
as you can see, the enum items are removed, am I doing it wrong ?
I suggest you change to this instead
when you export to MySQL you will have the enum.
1 Like
Hi @zoraj,
The DBML Enum syntax is actually like this:
Enum etat_chambre_type {
DIRTY
BUSY
CLEAN
OUT
}
Table t_hotel_chambre {
id int [pk, increment]
numero_chambre varchar(45)[not null, unique]
etat_chambre etat_chambre_type [not null]
}
You can read more here: https://www.dbml.org/docs/#enum-definition
1 Like