schema.rs 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. table! {
  2. attachments (id) {
  3. id -> Text,
  4. cipher_uuid -> Text,
  5. file_name -> Text,
  6. file_size -> BigInt,
  7. akey -> Nullable<Text>,
  8. }
  9. }
  10. table! {
  11. ciphers (uuid) {
  12. uuid -> Text,
  13. created_at -> Datetime,
  14. updated_at -> Datetime,
  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<Datetime>,
  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 -> Datetime,
  46. updated_at -> Datetime,
  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 -> Varchar,
  59. event_type -> Integer,
  60. user_uuid -> Nullable<Varchar>,
  61. org_uuid -> Nullable<Varchar>,
  62. cipher_uuid -> Nullable<Varchar>,
  63. collection_uuid -> Nullable<Varchar>,
  64. group_uuid -> Nullable<Varchar>,
  65. org_user_uuid -> Nullable<Varchar>,
  66. act_user_uuid -> Nullable<Varchar>,
  67. device_type -> Nullable<Integer>,
  68. ip_address -> Nullable<Text>,
  69. event_date -> Timestamp,
  70. policy_uuid -> Nullable<Varchar>,
  71. provider_uuid -> Nullable<Varchar>,
  72. provider_user_uuid -> Nullable<Varchar>,
  73. provider_org_uuid -> Nullable<Varchar>,
  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 -> Datetime,
  86. updated_at -> Datetime,
  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 -> Datetime,
  136. revision_date -> Datetime,
  137. expiration_date -> Nullable<Datetime>,
  138. deletion_date -> Datetime,
  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 -> BigInt,
  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. twofactor_duo_ctx (state) {
  164. state -> Text,
  165. user_email -> Text,
  166. nonce -> Text,
  167. exp -> BigInt,
  168. }
  169. }
  170. table! {
  171. users (uuid) {
  172. uuid -> Text,
  173. enabled -> Bool,
  174. created_at -> Datetime,
  175. updated_at -> Datetime,
  176. verified_at -> Nullable<Datetime>,
  177. last_verifying_at -> Nullable<Datetime>,
  178. login_verify_count -> Integer,
  179. email -> Text,
  180. email_new -> Nullable<Text>,
  181. email_new_token -> Nullable<Text>,
  182. name -> Text,
  183. password_hash -> Binary,
  184. salt -> Binary,
  185. password_iterations -> Integer,
  186. password_hint -> Nullable<Text>,
  187. akey -> Text,
  188. private_key -> Nullable<Text>,
  189. public_key -> Nullable<Text>,
  190. totp_secret -> Nullable<Text>,
  191. totp_recover -> Nullable<Text>,
  192. security_stamp -> Text,
  193. stamp_exception -> Nullable<Text>,
  194. equivalent_domains -> Text,
  195. excluded_globals -> Text,
  196. client_kdf_type -> Integer,
  197. client_kdf_iter -> Integer,
  198. client_kdf_memory -> Nullable<Integer>,
  199. client_kdf_parallelism -> Nullable<Integer>,
  200. api_key -> Nullable<Text>,
  201. avatar_color -> Nullable<Text>,
  202. external_id -> Nullable<Text>,
  203. }
  204. }
  205. table! {
  206. users_collections (user_uuid, collection_uuid) {
  207. user_uuid -> Text,
  208. collection_uuid -> Text,
  209. read_only -> Bool,
  210. hide_passwords -> Bool,
  211. }
  212. }
  213. table! {
  214. users_organizations (uuid) {
  215. uuid -> Text,
  216. user_uuid -> Text,
  217. org_uuid -> Text,
  218. access_all -> Bool,
  219. akey -> Text,
  220. status -> Integer,
  221. atype -> Integer,
  222. reset_password_key -> Nullable<Text>,
  223. external_id -> Nullable<Text>,
  224. }
  225. }
  226. table! {
  227. organization_api_key (uuid, org_uuid) {
  228. uuid -> Text,
  229. org_uuid -> Text,
  230. atype -> Integer,
  231. api_key -> Text,
  232. revision_date -> Timestamp,
  233. }
  234. }
  235. table! {
  236. emergency_access (uuid) {
  237. uuid -> Text,
  238. grantor_uuid -> Text,
  239. grantee_uuid -> Nullable<Text>,
  240. email -> Nullable<Text>,
  241. key_encrypted -> Nullable<Text>,
  242. atype -> Integer,
  243. status -> Integer,
  244. wait_time_days -> Integer,
  245. recovery_initiated_at -> Nullable<Timestamp>,
  246. last_notification_at -> Nullable<Timestamp>,
  247. updated_at -> Timestamp,
  248. created_at -> Timestamp,
  249. }
  250. }
  251. table! {
  252. groups (uuid) {
  253. uuid -> Text,
  254. organizations_uuid -> Text,
  255. name -> Text,
  256. access_all -> Bool,
  257. external_id -> Nullable<Text>,
  258. creation_date -> Timestamp,
  259. revision_date -> Timestamp,
  260. }
  261. }
  262. table! {
  263. groups_users (groups_uuid, users_organizations_uuid) {
  264. groups_uuid -> Text,
  265. users_organizations_uuid -> Text,
  266. }
  267. }
  268. table! {
  269. collections_groups (collections_uuid, groups_uuid) {
  270. collections_uuid -> Text,
  271. groups_uuid -> Text,
  272. read_only -> Bool,
  273. hide_passwords -> Bool,
  274. }
  275. }
  276. table! {
  277. auth_requests (uuid) {
  278. uuid -> Text,
  279. user_uuid -> Text,
  280. organization_uuid -> Nullable<Text>,
  281. request_device_identifier -> Text,
  282. device_type -> Integer,
  283. request_ip -> Text,
  284. response_device_id -> Nullable<Text>,
  285. access_code -> Text,
  286. public_key -> Text,
  287. enc_key -> Nullable<Text>,
  288. master_password_hash -> Nullable<Text>,
  289. approved -> Nullable<Bool>,
  290. creation_date -> Timestamp,
  291. response_date -> Nullable<Timestamp>,
  292. authentication_date -> Nullable<Timestamp>,
  293. }
  294. }
  295. joinable!(attachments -> ciphers (cipher_uuid));
  296. joinable!(ciphers -> organizations (organization_uuid));
  297. joinable!(ciphers -> users (user_uuid));
  298. joinable!(ciphers_collections -> ciphers (cipher_uuid));
  299. joinable!(ciphers_collections -> collections (collection_uuid));
  300. joinable!(collections -> organizations (org_uuid));
  301. joinable!(devices -> users (user_uuid));
  302. joinable!(folders -> users (user_uuid));
  303. joinable!(folders_ciphers -> ciphers (cipher_uuid));
  304. joinable!(folders_ciphers -> folders (folder_uuid));
  305. joinable!(org_policies -> organizations (org_uuid));
  306. joinable!(sends -> organizations (organization_uuid));
  307. joinable!(sends -> users (user_uuid));
  308. joinable!(twofactor -> users (user_uuid));
  309. joinable!(users_collections -> collections (collection_uuid));
  310. joinable!(users_collections -> users (user_uuid));
  311. joinable!(users_organizations -> organizations (org_uuid));
  312. joinable!(users_organizations -> users (user_uuid));
  313. joinable!(users_organizations -> ciphers (org_uuid));
  314. joinable!(organization_api_key -> organizations (org_uuid));
  315. joinable!(emergency_access -> users (grantor_uuid));
  316. joinable!(groups -> organizations (organizations_uuid));
  317. joinable!(groups_users -> users_organizations (users_organizations_uuid));
  318. joinable!(groups_users -> groups (groups_uuid));
  319. joinable!(collections_groups -> collections (collections_uuid));
  320. joinable!(collections_groups -> groups (groups_uuid));
  321. joinable!(event -> users_organizations (uuid));
  322. joinable!(auth_requests -> users (user_uuid));
  323. allow_tables_to_appear_in_same_query!(
  324. attachments,
  325. ciphers,
  326. ciphers_collections,
  327. collections,
  328. devices,
  329. folders,
  330. folders_ciphers,
  331. invitations,
  332. org_policies,
  333. organizations,
  334. sends,
  335. twofactor,
  336. users,
  337. users_collections,
  338. users_organizations,
  339. organization_api_key,
  340. emergency_access,
  341. groups,
  342. groups_users,
  343. collections_groups,
  344. event,
  345. auth_requests,
  346. );