Skip to content

Commit 08284dc

Browse files
committed
Update database schema
1 parent 5a9d546 commit 08284dc

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

docs/links/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@ A link database. Database items are links to resources available on the web.
1515

1616
## Usage
1717

18-
The database is a [JSON][json] file, where each `key` is a resource identifier and each `value` is a URL specifying the location of a resource accessible via the web.
18+
The database is a [JSON][json] file, where each `key` is a URL specifying the location of a resource accessible via the web and each `value` is an `object` containing the resource `id` and other meta information.
1919

2020
``` text
2121
{
2222
...
23-
"json": "http://www.json.org/",
23+
"http://www.json.org/": {
24+
"id": "json",
25+
"short": ""
26+
},
2427
....
2528
}
2629
```
@@ -35,6 +38,7 @@ The database is a [JSON][json] file, where each `key` is a resource identifier a
3538
## Notes
3639

3740
* When adding a database entry, ensure that resource identifiers (keys) are __sorted__ in alphabetical order.
41+
* Before assigning an `id` to a URL, ensure that the `id` is __unique__.
3842
* Ensure that a URL is [__percent-encoded__][percent-encoding].
3943

4044
</section>

docs/links/database.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
{
2-
"json": "http://www.json.org/",
3-
"percent-encoding": "https://en.wikipedia.org/wiki/Percent-encoding"
2+
"http://www.json.org/": {
3+
"id": "json",
4+
"short": ""
5+
},
6+
"https://en.wikipedia.org/wiki/Percent-encoding": {
7+
"id": "percent-encoding",
8+
"short": ""
9+
}
410
}

0 commit comments

Comments
 (0)