schema.rs 9.2 KB

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