Current section
Files
Jump to
Current section
Files
test/data/misc.dbml
enum color {
abc
efg // Test comment
}
Table bed as B {
bed_id integer [primary key]
type bed_type [primary key, note: "twin, full, king"]
created_at timestamp [not null]
updated_at timestamp [note: '''
💸 1 = processing,
✔️ 2 = shipped,
❌ 3 = cancelled,
😔 4 = refunded
'''
]
Note: 'Stores bed info'
indexes {
booking_date
description [unique, name: 'idx_bed_profile_description', note: 'Text']
(id, country) [pk] // composite primary key
(country, booking_date) [unique]
booking_date [type: hash]
(`id*2`)
}
}
Table unit_profile {
unit_id integer [primary key, ref: > unit.unit_id]
profile_id integer [primary key, ref: > profile.profile_id]
created_at timestamp [not null, note: "This is a timestamp"]
updated_at timestamp
Note: '''
Defines unit profile,
which is a multi-line string
'''
}
TableGroup tablegroup_name [color: #345abc] { // tablegroup is case-insensitive.
B
unit_profile
user
}