schema.rs 9.1 KB

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