Skip to content

Commit 03d2511

Browse files
authored
Add draft ERD schema definition in DBML format
Draft ERD schema definition using DBML for database structure.
1 parent 0a20b23 commit 03d2511

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// Use DBML to define your database structure
2+
// Docs: https://dbml.dbdiagram.io/docs
3+
4+
Table users {
5+
user_id integer [primary key]
6+
username varchar
7+
email string
8+
password string
9+
created_at datetime
10+
rating int
11+
}
12+
13+
Table organisations {
14+
organisation_id integer [primary key]
15+
owner integer [ref: - users.user_id]
16+
created_at timestamp
17+
}
18+
19+
Table members {
20+
user_id integer [ref: - users.user_id]
21+
organisation_id integer [ref: - organisations.organisation_id]
22+
created_at timestamp
23+
}
24+
25+
Table Inventory {
26+
item_id integer [primary key]
27+
owner integer [ref: - organisations.organisation_id]
28+
name varchar
29+
description text
30+
quantity integer [not null]
31+
available boolean
32+
}
33+
34+
Table Loaned {
35+
transaction_id integer [primary key]
36+
lender integer [ref: - organisations.organisation_id]
37+
borrower integer [ref: - users.user_id]
38+
item integer [ref: - Inventory.item_id]
39+
loan_start datetime
40+
loan_end datetime
41+
42+
}
43+
44+
45+
46+
47+
48+
49+
50+
51+
52+
53+
54+
55+

0 commit comments

Comments
 (0)