schema.rs 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. table! {
  2. attachments (id) {
  3. id -> Text,
  4. cipher_uuid -> Text,
  5. file_name -> Text,
  6. file_size -> Integer,
  7. akey -> Nullable<Text>,
  8. }
  9. }
  10. table! {
  11. ciphers (uuid) {
  12. uuid -> Text,
  13. created_at -> Timestamp,
  14. updated_at -> Timestamp,
  15. user_uuid -> Nullable<Text>,
  16. organization_uuid -> Nullable<Text>,
  17. atype -> Integer,
  18. name -> Text,
  19. notes -> Nullable<Text>,
  20. fields -> Nullable<Text>,
  21. data -> Text,
  22. password_history -> Nullable<Text>,
  23. deleted_at -> Nullable<Timestamp>,
  24. reprompt -> Nullable<Integer>,
  25. }
  26. }
  27. table! {
  28. ciphers_collections (cipher_uuid, collection_uuid) {
  29. cipher_uuid -> Text,
  30. collection_uuid -> Text,
  31. }
  32. }
  33. table! {
  34. collections (uuid) {
  35. uuid -> Text,
  36. org_uuid -> Text,
  37. name -> Text,
  38. }
  39. }
  40. table! {
  41. devices (uuid, user_uuid) {
  42. uuid -> Text,
  43. created_at -> Timestamp,
  44. updated_at -> Timestamp,
  45. user_uuid -> Text,
  46. name -> Text,
  47. atype -> Integer,
  48. push_uuid -> Nullable<Text>,
  49. push_token -> Nullable<Text>,
  50. refresh_token -> Text,
  51. twofactor_remember -> Nullable<Text>,
  52. }
  53. }
  54. table! {
  55. event (uuid) {
  56. uuid -> Text,
  57. event_type -> Integer,
  58. user_uuid -> Nullable<Text>,
  59. org_uuid -> Nullable<Text>,
  60. cipher_uuid -> Nullable<Text>,
  61. collection_uuid -> Nullable<Text>,
  62. group_uuid -> Nullable<Text>,
  63. org_user_uuid -> Nullable<Text>,
  64. act_user_uuid -> Nullable<Text>,
  65. device_type -> Nullable<Integer>,
  66. ip_address -> Nullable<Text>,
  67. event_date -> Timestamp,
  68. policy_uuid -> Nullable<Text>,
  69. provider_uuid -> Nullable<Text>,
  70. provider_user_uuid -> Nullable<Text>,
  71. provider_org_uuid -> Nullable<Text>,
  72. }
  73. }
  74. table! {
  75. favorites (user_uuid, cipher_uuid) {
  76. user_uuid -> Text,
  77. cipher_uuid -> Text,
  78. }
  79. }
  80. table! {
  81. folders (uuid) {
  82. uuid -> Text,
  83. created_at -> Timestamp,
  84. updated_at -> Timestamp,
  85. user_uuid -> Text,
  86. name -> Text,
  87. }
  88. }
  89. table! {
  90. folders_ciphers (cipher_uuid, folder_uuid) {
  91. cipher_uuid -> Text,
  92. folder_uuid -> Text,
  93. }
  94. }
  95. table! {
  96. invitations (email) {
  97. email -> Text,
  98. }
  99. }
  100. table! {
  101. org_policies (uuid) {
  102. uuid -> Text,
  103. org_uuid -> Text,
  104. atype -> Integer,
  105. enabled -> Bool,
  106. data -> Text,
  107. }
  108. }
  109. table! {
  110. organizations (uuid) {
  111. uuid -> Text,
  112. name -> Text,
  113. billing_email -> Text,
  114. private_key -> Nullable<Text>,
  115. public_key -> Nullable<Text>,
  116. }
  117. }
  118. table! {
  119. sends (uuid) {
  120. uuid -> Text,
  121. user_uuid -> Nullable<Text>,
  122. organization_uuid -> Nullable<Text>,
  123. name -> Text,
  124. notes -> Nullable<Text>,
  125. atype -> Integer,
  126. data -> Text,
  127. akey -> Text,
  128. password_hash -> Nullable<Binary>,
  129. password_salt -> Nullable<Binary>,
  130. password_iter -> Nullable<Integer>,
  131. max_access_count -> Nullable<Integer>,
  132. access_count -> Integer,
  133. creation_date -> Timestamp,
  134. revision_date -> Timestamp,
  135. expiration_date -> Nullable<Timestamp>,
  136. deletion_date -> Timestamp,
  137. disabled -> Bool,
  138. hide_email -> Nullable<Bool>,
  139. }
  140. }
  141. table! {
  142. twofactor (uuid) {
  143. uuid -> Text,
  144. user_uuid -> Text,
  145. atype -> Integer,
  146. enabled -> Bool,
  147. data -> Text,
  148. last_used -> Integer,
  149. }
  150. }
  151. table! {
  152. twofactor_incomplete (user_uuid, device_uuid) {
  153. user_uuid -> Text,
  154. device_uuid -> Text,
  155. device_name -> Text,
  156. login_time -> Timestamp,
  157. ip_address -> Text,
  158. }
  159. }
  160. table! {
  161. users (uuid) {
  162. uuid -> Text,
  163. enabled -> Bool,
  164. created_at -> Timestamp,
  165. updated_at -> Timestamp,
  166. verified_at -> Nullable<Timestamp>,
  167. last_verifying_at -> Nullable<Timestamp>,
  168. login_verify_count -> Integer,
  169. email -> Text,
  170. email_new -> Nullable<Text>,
  171. email_new_token -> Nullable<Text>,
  172. name -> Text,
  173. password_hash -> Binary,
  174. salt -> Binary,
  175. password_iterations -> Integer,
  176. password_hint -> Nullable<Text>,
  177. akey -> Text,
  178. private_key -> Nullable<Text>,
  179. public_key -> Nullable<Text>,
  180. totp_secret -> Nullable<Text>,
  181. totp_recover -> Nullable<Text>,
  182. security_stamp -> Text,
  183. stamp_exception -> Nullable<Text>,
  184. equivalent_domains -> Text,
  185. excluded_globals -> Text,
  186. client_kdf_type -> Integer,
  187. client_kdf_iter -> Integer,
  188. client_kdf_memory -> Nullable<Integer>,
  189. client_kdf_parallelism -> Nullable<Integer>,
  190. api_key -> Nullable<Text>,
  191. avatar_color -> Nullable<Text>,
  192. }
  193. }
  194. table! {
  195. users_collections (user_uuid, collection_uuid) {
  196. user_uuid -> Text,
  197. collection_uuid -> Text,
  198. read_only -> Bool,
  199. hide_passwords -> Bool,
  200. }
  201. }
  202. table! {
  203. users_organizations (uuid) {
  204. uuid -> Text,
  205. user_uuid -> Text,
  206. org_uuid -> Text,
  207. access_all -> Bool,
  208. akey -> Text,
  209. status -> Integer,
  210. atype -> Integer,
  211. reset_password_key -> Nullable<Text>,
  212. }
  213. }
  214. table! {
  215. emergency_access (uuid) {
  216. uuid -> Text,
  217. grantor_uuid -> Text,
  218. grantee_uuid -> Nullable<Text>,
  219. email -> Nullable<Text>,
  220. key_encrypted -> Nullable<Text>,
  221. atype -> Integer,
  222. status -> Integer,
  223. wait_time_days -> Integer,
  224. recovery_initiated_at -> Nullable<Timestamp>,
  225. last_notification_at -> Nullable<Timestamp>,
  226. updated_at -> Timestamp,
  227. created_at -> Timestamp,
  228. }
  229. }
  230. table! {
  231. groups (uuid) {
  232. uuid -> Text,
  233. organizations_uuid -> Text,
  234. name -> Text,
  235. access_all -> Bool,
  236. external_id -> Nullable<Text>,
  237. creation_date -> Timestamp,
  238. revision_date -> Timestamp,
  239. }
  240. }
  241. table! {
  242. groups_users (groups_uuid, users_organizations_uuid) {
  243. groups_uuid -> Text,
  244. users_organizations_uuid -> Text,
  245. }
  246. }
  247. table! {
  248. collections_groups (collections_uuid, groups_uuid) {
  249. collections_uuid -> Text,
  250. groups_uuid -> Text,
  251. read_only -> Bool,
  252. hide_passwords -> Bool,
  253. }
  254. }
  255. joinable!(attachments -> ciphers (cipher_uuid));
  256. joinable!(ciphers -> organizations (organization_uuid));
  257. joinable!(ciphers -> users (user_uuid));
  258. joinable!(ciphers_collections -> ciphers (cipher_uuid));
  259. joinable!(ciphers_collections -> collections (collection_uuid));
  260. joinable!(collections -> organizations (org_uuid));
  261. joinable!(devices -> users (user_uuid));
  262. joinable!(folders -> users (user_uuid));
  263. joinable!(folders_ciphers -> ciphers (cipher_uuid));
  264. joinable!(folders_ciphers -> folders (folder_uuid));
  265. joinable!(org_policies -> organizations (org_uuid));
  266. joinable!(sends -> organizations (organization_uuid));
  267. joinable!(sends -> users (user_uuid));
  268. joinable!(twofactor -> users (user_uuid));
  269. joinable!(users_collections -> collections (collection_uuid));
  270. joinable!(users_collections -> users (user_uuid));
  271. joinable!(users_organizations -> organizations (org_uuid));
  272. joinable!(users_organizations -> users (user_uuid));
  273. joinable!(emergency_access -> users (grantor_uuid));
  274. joinable!(groups -> organizations (organizations_uuid));
  275. joinable!(groups_users -> users_organizations (users_organizations_uuid));
  276. joinable!(groups_users -> groups (groups_uuid));
  277. joinable!(collections_groups -> collections (collections_uuid));
  278. joinable!(collections_groups -> groups (groups_uuid));
  279. joinable!(event -> users_organizations (uuid));
  280. allow_tables_to_appear_in_same_query!(
  281. attachments,
  282. ciphers,
  283. ciphers_collections,
  284. collections,
  285. devices,
  286. folders,
  287. folders_ciphers,
  288. invitations,
  289. org_policies,
  290. organizations,
  291. sends,
  292. twofactor,
  293. users,
  294. users_collections,
  295. users_organizations,
  296. emergency_access,
  297. groups,
  298. groups_users,
  299. collections_groups,
  300. event,
  301. );