dbml
dbml copied to clipboard
Add support for custom constraints
for example, how can I use dbml to give this description :
CREATE TABLE `MyTable` (
`id` INT PRIMARY KEY AUTO_INCREMENT,
`foreignKey1` INT,
`foreignKey2` INT,
CONSTRAINT `check_foreign_key` CHECK (`foreignKey1` IN (SELECT `id` FROM `OtherTable1`) OR `foreignKey2` IN (SELECT `id` FROM `OtherTable2`)))
);
Hi,
For the columns and table, you can define dbml like this (However, there's currently no equivalent dbml syntax for CHECK CONTRAINTS):
Table "MyTable" {
"id" INT [pk, increment]
"foreignKey1" INT
"foreignKey2" INT
}