Advertisement
shakasu

model

Feb 16th, 2021
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. [
  2. {
  3. "name": "User",
  4. "type": "record",
  5. "logicalType": "Aggregate",
  6. "fields": [
  7. {"name": "uuid", "type": "string", "default": "-1"},
  8. {"name": "username", "type": "string"},
  9. {"name": "phone", "type": "string"}
  10.  
  11. ],
  12. "indexes": [
  13. "uuid",
  14. "phone"
  15. ],
  16. "relations": [
  17. { "name": "subscription", "to": "Subscription", "count": "many", "from_fields": "uuid", "to_fields": "user_uuid" }
  18. ]
  19. },
  20. {
  21. "name": "Book",
  22. "type": "record",
  23. "logicalType": "Aggregate",
  24. "fields": [
  25. {"name": "uuid", "type": "string", "default": "-1"},
  26. {"name": "book_name", "type": "string"},
  27. {"name": "author", "type": "string"}
  28. ],
  29. "indexes": ["uuid"],
  30. "relations": [
  31. { "name": "subscription", "to": "Subscription", "count": "many", "from_fields": "uuid", "to_fields": "book_uuid" }
  32. ]
  33. },
  34. {
  35. "name": "Subscription",
  36. "type": "record",
  37. "logicalType": "Aggregate",
  38. "fields": [
  39. {"name": "uuid", "type": "string", "default": "-1"},
  40. {"name": "user_uuid", "type": "string"},
  41. {"name": "book_uuid", "type": "string"}
  42. ],
  43. "indexes": [
  44. {"name":"pkey", "parts": ["uuid", "user_uuid"]},
  45. "user_uuid",
  46. "book_uuid",
  47. "uuid"
  48. ],
  49. "relations": [
  50. { "name": "user", "to": "User", "count": "one", "from_fields": "user_uuid", "to_fields": "uuid" },
  51. { "name": "book", "to": "Book", "count": "one", "from_fields": "book_uuid", "to_fields": "uuid" }
  52. ]
  53. }
  54. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement