-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema_example.json
45 lines (45 loc) · 1.7 KB
/
schema_example.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
"version": "1",
"name" : "main",
"tables": {
"schema": {
"columns": {
"name": {"type": "varchar(50)", "unique": true, "notnull": true},
"version": {"type": "integer", "notnull": true},
"schema" : {"type": "text", "notnull": true}
},
"index": {
"schema_name_idx": {"column": "name"}
}
},
"users": {
"columns": {
"user_id": {"type": "serial", "primary": true},
"user_name": {"type": "varchar(50)", "unique": true, "notnull": true},
"realname": {"type": "varchar(100)", "notnull": true},
"email": {"type": "varchar(255)", "unique": true, "notnull": true},
"passwd": {"type": "varchar(50)", "notnull": true}
},
"index": {
"users_user_name_idx": {"column": "user_name"}
}
},
"items": {
"columns": {
"id": {"type": "serial", "primary": true},
"name": {"type": "varchar(100)", "notnull": true, "unique": true},
"description": {"type": "varchar(255)"},
"price": {"type": "numeric(3,2)", "notnull": true},
"customer": {"type": "integer"},
"flag": {"type": "char", "notnull": true, "default": "Y"},
"date": {"type": "DATETIME"}
},
"fk": {
"fk_items_customer": {"columnname": "customer", "linktable": "users", "linkcolumn": "user_id"}
},
"index": {
"items_name_idx": {"column": "name", "unique": true}
}
}
}
}