dbschema.json 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {
  2. "db_name": "ZeroBlog",
  3. "db_file": "data/zeroblog.db",
  4. "version": 2,
  5. "maps": {
  6. "users/.+/data.json": {
  7. "to_table": [
  8. "comment",
  9. {"node": "comment_vote", "table": "comment_vote", "key_col": "comment_uri", "val_col": "vote"},
  10. {"node": "post_vote", "table": "post_vote", "key_col": "post_id", "val_col": "vote"}
  11. ]
  12. },
  13. "users/.+/content.json": {
  14. "to_keyvalue": [ "cert_user_id" ]
  15. },
  16. "data.json": {
  17. "to_table": [ "post" ],
  18. "to_keyvalue": [ "title", "description", "links", "next_post_id", "demo", "modified" ]
  19. }
  20. },
  21. "tables": {
  22. "comment": {
  23. "cols": [
  24. ["comment_id", "INTEGER"],
  25. ["post_id", "INTEGER"],
  26. ["body", "TEXT"],
  27. ["date_added", "INTEGER"],
  28. ["json_id", "INTEGER REFERENCES json (json_id)"]
  29. ],
  30. "indexes": ["CREATE UNIQUE INDEX comment_key ON comment(json_id, comment_id)", "CREATE INDEX comment_post_id ON comment(post_id)"],
  31. "schema_changed": 1426195823
  32. },
  33. "comment_vote": {
  34. "cols": [
  35. ["comment_uri", "TEXT"],
  36. ["vote", "INTEGER"],
  37. ["json_id", "INTEGER REFERENCES json (json_id)"]
  38. ],
  39. "indexes": ["CREATE INDEX comment_vote_comment_uri ON comment_vote(comment_uri)", "CREATE INDEX comment_vote_json_id ON comment_vote(json_id)"],
  40. "schema_changed": 1426195822
  41. },
  42. "post": {
  43. "cols": [
  44. ["post_id", "INTEGER"],
  45. ["title", "TEXT"],
  46. ["body", "TEXT"],
  47. ["date_published", "INTEGER"],
  48. ["json_id", "INTEGER REFERENCES json (json_id)"]
  49. ],
  50. "indexes": ["CREATE UNIQUE INDEX post_uri ON post(json_id, post_id)", "CREATE INDEX post_id ON post(post_id)"],
  51. "schema_changed": 1426195823
  52. },
  53. "post_vote": {
  54. "cols": [
  55. ["post_id", "INTEGER"],
  56. ["vote", "INTEGER"],
  57. ["json_id", "INTEGER REFERENCES json (json_id)"]
  58. ],
  59. "indexes": ["CREATE INDEX post_vote_post_id ON post_vote(post_id)", "CREATE INDEX post_vote_json_id ON post_vote(post_id)"],
  60. "schema_changed": 1426195826
  61. }
  62. }
  63. }