0001_snapshot.json 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. {
  2. "id": "e8379a18-09c8-4738-8c16-7951d2260472",
  3. "prevId": "0ae16ec8-cab7-46f6-927c-3bb1022a5ebd",
  4. "version": "7",
  5. "dialect": "postgresql",
  6. "tables": {
  7. "public.group_roles": {
  8. "name": "group_roles",
  9. "schema": "",
  10. "columns": {
  11. "group_id": {
  12. "name": "group_id",
  13. "type": "uuid",
  14. "primaryKey": false,
  15. "notNull": false
  16. },
  17. "role_id": {
  18. "name": "role_id",
  19. "type": "uuid",
  20. "primaryKey": false,
  21. "notNull": false
  22. }
  23. },
  24. "indexes": {},
  25. "foreignKeys": {
  26. "group_roles_group_id_groups_id_fk": {
  27. "name": "group_roles_group_id_groups_id_fk",
  28. "tableFrom": "group_roles",
  29. "tableTo": "groups",
  30. "columnsFrom": [
  31. "group_id"
  32. ],
  33. "columnsTo": [
  34. "id"
  35. ],
  36. "onDelete": "cascade",
  37. "onUpdate": "no action"
  38. },
  39. "group_roles_role_id_roles_id_fk": {
  40. "name": "group_roles_role_id_roles_id_fk",
  41. "tableFrom": "group_roles",
  42. "tableTo": "roles",
  43. "columnsFrom": [
  44. "role_id"
  45. ],
  46. "columnsTo": [
  47. "id"
  48. ],
  49. "onDelete": "cascade",
  50. "onUpdate": "no action"
  51. }
  52. },
  53. "compositePrimaryKeys": {
  54. "group_roles_group_id_role_id_pk": {
  55. "name": "group_roles_group_id_role_id_pk",
  56. "columns": [
  57. "group_id",
  58. "role_id"
  59. ]
  60. }
  61. },
  62. "uniqueConstraints": {},
  63. "policies": {},
  64. "checkConstraints": {},
  65. "isRLSEnabled": false
  66. },
  67. "public.groups": {
  68. "name": "groups",
  69. "schema": "",
  70. "columns": {
  71. "id": {
  72. "name": "id",
  73. "type": "uuid",
  74. "primaryKey": true,
  75. "notNull": true,
  76. "default": "gen_random_uuid()"
  77. },
  78. "name": {
  79. "name": "name",
  80. "type": "varchar(100)",
  81. "primaryKey": false,
  82. "notNull": true
  83. },
  84. "parent_id": {
  85. "name": "parent_id",
  86. "type": "uuid",
  87. "primaryKey": false,
  88. "notNull": false
  89. },
  90. "created_at": {
  91. "name": "created_at",
  92. "type": "timestamp",
  93. "primaryKey": false,
  94. "notNull": true,
  95. "default": "now()"
  96. }
  97. },
  98. "indexes": {},
  99. "foreignKeys": {},
  100. "compositePrimaryKeys": {},
  101. "uniqueConstraints": {},
  102. "policies": {},
  103. "checkConstraints": {},
  104. "isRLSEnabled": false
  105. },
  106. "public.permissions": {
  107. "name": "permissions",
  108. "schema": "",
  109. "columns": {
  110. "id": {
  111. "name": "id",
  112. "type": "uuid",
  113. "primaryKey": true,
  114. "notNull": true,
  115. "default": "gen_random_uuid()"
  116. },
  117. "action": {
  118. "name": "action",
  119. "type": "varchar(50)",
  120. "primaryKey": false,
  121. "notNull": true
  122. },
  123. "resource_type": {
  124. "name": "resource_type",
  125. "type": "varchar(50)",
  126. "primaryKey": false,
  127. "notNull": true
  128. }
  129. },
  130. "indexes": {},
  131. "foreignKeys": {},
  132. "compositePrimaryKeys": {},
  133. "uniqueConstraints": {},
  134. "policies": {},
  135. "checkConstraints": {},
  136. "isRLSEnabled": false
  137. },
  138. "public.role_permissions": {
  139. "name": "role_permissions",
  140. "schema": "",
  141. "columns": {
  142. "role_id": {
  143. "name": "role_id",
  144. "type": "uuid",
  145. "primaryKey": false,
  146. "notNull": false
  147. },
  148. "permission_id": {
  149. "name": "permission_id",
  150. "type": "uuid",
  151. "primaryKey": false,
  152. "notNull": false
  153. }
  154. },
  155. "indexes": {},
  156. "foreignKeys": {
  157. "role_permissions_role_id_roles_id_fk": {
  158. "name": "role_permissions_role_id_roles_id_fk",
  159. "tableFrom": "role_permissions",
  160. "tableTo": "roles",
  161. "columnsFrom": [
  162. "role_id"
  163. ],
  164. "columnsTo": [
  165. "id"
  166. ],
  167. "onDelete": "cascade",
  168. "onUpdate": "no action"
  169. },
  170. "role_permissions_permission_id_permissions_id_fk": {
  171. "name": "role_permissions_permission_id_permissions_id_fk",
  172. "tableFrom": "role_permissions",
  173. "tableTo": "permissions",
  174. "columnsFrom": [
  175. "permission_id"
  176. ],
  177. "columnsTo": [
  178. "id"
  179. ],
  180. "onDelete": "cascade",
  181. "onUpdate": "no action"
  182. }
  183. },
  184. "compositePrimaryKeys": {
  185. "role_permissions_role_id_permission_id_pk": {
  186. "name": "role_permissions_role_id_permission_id_pk",
  187. "columns": [
  188. "role_id",
  189. "permission_id"
  190. ]
  191. }
  192. },
  193. "uniqueConstraints": {},
  194. "policies": {},
  195. "checkConstraints": {},
  196. "isRLSEnabled": false
  197. },
  198. "public.roles": {
  199. "name": "roles",
  200. "schema": "",
  201. "columns": {
  202. "id": {
  203. "name": "id",
  204. "type": "uuid",
  205. "primaryKey": true,
  206. "notNull": true,
  207. "default": "gen_random_uuid()"
  208. },
  209. "name": {
  210. "name": "name",
  211. "type": "varchar(50)",
  212. "primaryKey": false,
  213. "notNull": true
  214. },
  215. "description": {
  216. "name": "description",
  217. "type": "text",
  218. "primaryKey": false,
  219. "notNull": false
  220. }
  221. },
  222. "indexes": {},
  223. "foreignKeys": {},
  224. "compositePrimaryKeys": {},
  225. "uniqueConstraints": {
  226. "roles_name_unique": {
  227. "name": "roles_name_unique",
  228. "nullsNotDistinct": false,
  229. "columns": [
  230. "name"
  231. ]
  232. }
  233. },
  234. "policies": {},
  235. "checkConstraints": {},
  236. "isRLSEnabled": false
  237. },
  238. "public.user_groups": {
  239. "name": "user_groups",
  240. "schema": "",
  241. "columns": {
  242. "user_id": {
  243. "name": "user_id",
  244. "type": "uuid",
  245. "primaryKey": false,
  246. "notNull": false
  247. },
  248. "group_id": {
  249. "name": "group_id",
  250. "type": "uuid",
  251. "primaryKey": false,
  252. "notNull": false
  253. }
  254. },
  255. "indexes": {},
  256. "foreignKeys": {
  257. "user_groups_user_id_users_id_fk": {
  258. "name": "user_groups_user_id_users_id_fk",
  259. "tableFrom": "user_groups",
  260. "tableTo": "users",
  261. "columnsFrom": [
  262. "user_id"
  263. ],
  264. "columnsTo": [
  265. "id"
  266. ],
  267. "onDelete": "cascade",
  268. "onUpdate": "no action"
  269. },
  270. "user_groups_group_id_groups_id_fk": {
  271. "name": "user_groups_group_id_groups_id_fk",
  272. "tableFrom": "user_groups",
  273. "tableTo": "groups",
  274. "columnsFrom": [
  275. "group_id"
  276. ],
  277. "columnsTo": [
  278. "id"
  279. ],
  280. "onDelete": "cascade",
  281. "onUpdate": "no action"
  282. }
  283. },
  284. "compositePrimaryKeys": {
  285. "user_groups_user_id_group_id_pk": {
  286. "name": "user_groups_user_id_group_id_pk",
  287. "columns": [
  288. "user_id",
  289. "group_id"
  290. ]
  291. }
  292. },
  293. "uniqueConstraints": {},
  294. "policies": {},
  295. "checkConstraints": {},
  296. "isRLSEnabled": false
  297. },
  298. "public.user_roles": {
  299. "name": "user_roles",
  300. "schema": "",
  301. "columns": {
  302. "user_id": {
  303. "name": "user_id",
  304. "type": "uuid",
  305. "primaryKey": false,
  306. "notNull": false
  307. },
  308. "role_id": {
  309. "name": "role_id",
  310. "type": "uuid",
  311. "primaryKey": false,
  312. "notNull": false
  313. }
  314. },
  315. "indexes": {},
  316. "foreignKeys": {
  317. "user_roles_user_id_users_id_fk": {
  318. "name": "user_roles_user_id_users_id_fk",
  319. "tableFrom": "user_roles",
  320. "tableTo": "users",
  321. "columnsFrom": [
  322. "user_id"
  323. ],
  324. "columnsTo": [
  325. "id"
  326. ],
  327. "onDelete": "cascade",
  328. "onUpdate": "no action"
  329. },
  330. "user_roles_role_id_roles_id_fk": {
  331. "name": "user_roles_role_id_roles_id_fk",
  332. "tableFrom": "user_roles",
  333. "tableTo": "roles",
  334. "columnsFrom": [
  335. "role_id"
  336. ],
  337. "columnsTo": [
  338. "id"
  339. ],
  340. "onDelete": "cascade",
  341. "onUpdate": "no action"
  342. }
  343. },
  344. "compositePrimaryKeys": {
  345. "user_roles_user_id_role_id_pk": {
  346. "name": "user_roles_user_id_role_id_pk",
  347. "columns": [
  348. "user_id",
  349. "role_id"
  350. ]
  351. }
  352. },
  353. "uniqueConstraints": {},
  354. "policies": {},
  355. "checkConstraints": {},
  356. "isRLSEnabled": false
  357. },
  358. "public.users": {
  359. "name": "users",
  360. "schema": "",
  361. "columns": {
  362. "id": {
  363. "name": "id",
  364. "type": "uuid",
  365. "primaryKey": true,
  366. "notNull": true,
  367. "default": "gen_random_uuid()"
  368. },
  369. "email": {
  370. "name": "email",
  371. "type": "varchar(255)",
  372. "primaryKey": false,
  373. "notNull": true
  374. },
  375. "name": {
  376. "name": "name",
  377. "type": "text",
  378. "primaryKey": false,
  379. "notNull": false
  380. },
  381. "password_hash": {
  382. "name": "password_hash",
  383. "type": "text",
  384. "primaryKey": false,
  385. "notNull": true
  386. },
  387. "created_at": {
  388. "name": "created_at",
  389. "type": "timestamp",
  390. "primaryKey": false,
  391. "notNull": true,
  392. "default": "now()"
  393. },
  394. "updated_at": {
  395. "name": "updated_at",
  396. "type": "timestamp",
  397. "primaryKey": false,
  398. "notNull": true,
  399. "default": "now()"
  400. }
  401. },
  402. "indexes": {},
  403. "foreignKeys": {},
  404. "compositePrimaryKeys": {},
  405. "uniqueConstraints": {
  406. "users_email_unique": {
  407. "name": "users_email_unique",
  408. "nullsNotDistinct": false,
  409. "columns": [
  410. "email"
  411. ]
  412. }
  413. },
  414. "policies": {},
  415. "checkConstraints": {},
  416. "isRLSEnabled": false
  417. },
  418. "public.media": {
  419. "name": "media",
  420. "schema": "",
  421. "columns": {
  422. "id": {
  423. "name": "id",
  424. "type": "uuid",
  425. "primaryKey": true,
  426. "notNull": true,
  427. "default": "gen_random_uuid()"
  428. },
  429. "filename": {
  430. "name": "filename",
  431. "type": "varchar(255)",
  432. "primaryKey": false,
  433. "notNull": true
  434. },
  435. "storage_key": {
  436. "name": "storage_key",
  437. "type": "text",
  438. "primaryKey": false,
  439. "notNull": true
  440. },
  441. "mime_type": {
  442. "name": "mime_type",
  443. "type": "varchar(100)",
  444. "primaryKey": false,
  445. "notNull": false
  446. },
  447. "size": {
  448. "name": "size",
  449. "type": "bigint",
  450. "primaryKey": false,
  451. "notNull": true
  452. },
  453. "status": {
  454. "name": "status",
  455. "type": "varchar(20)",
  456. "primaryKey": false,
  457. "notNull": true,
  458. "default": "'pending'"
  459. },
  460. "metadata": {
  461. "name": "metadata",
  462. "type": "jsonb",
  463. "primaryKey": false,
  464. "notNull": false
  465. },
  466. "created_at": {
  467. "name": "created_at",
  468. "type": "timestamp",
  469. "primaryKey": false,
  470. "notNull": true,
  471. "default": "now()"
  472. },
  473. "updated_at": {
  474. "name": "updated_at",
  475. "type": "timestamp",
  476. "primaryKey": false,
  477. "notNull": true,
  478. "default": "now()"
  479. }
  480. },
  481. "indexes": {},
  482. "foreignKeys": {},
  483. "compositePrimaryKeys": {},
  484. "uniqueConstraints": {
  485. "media_storage_key_unique": {
  486. "name": "media_storage_key_unique",
  487. "nullsNotDistinct": false,
  488. "columns": [
  489. "storage_key"
  490. ]
  491. }
  492. },
  493. "policies": {},
  494. "checkConstraints": {},
  495. "isRLSEnabled": false
  496. },
  497. "public.acl_rules": {
  498. "name": "acl_rules",
  499. "schema": "",
  500. "columns": {
  501. "id": {
  502. "name": "id",
  503. "type": "uuid",
  504. "primaryKey": true,
  505. "notNull": true,
  506. "default": "gen_random_uuid()"
  507. },
  508. "resource_id": {
  509. "name": "resource_id",
  510. "type": "uuid",
  511. "primaryKey": false,
  512. "notNull": true
  513. },
  514. "subject_type": {
  515. "name": "subject_type",
  516. "type": "varchar(20)",
  517. "primaryKey": false,
  518. "notNull": true
  519. },
  520. "subject_id": {
  521. "name": "subject_id",
  522. "type": "uuid",
  523. "primaryKey": false,
  524. "notNull": true
  525. },
  526. "permission_type": {
  527. "name": "permission_type",
  528. "type": "varchar(20)",
  529. "primaryKey": false,
  530. "notNull": true
  531. },
  532. "action": {
  533. "name": "action",
  534. "type": "varchar(50)",
  535. "primaryKey": false,
  536. "notNull": true
  537. },
  538. "created_at": {
  539. "name": "created_at",
  540. "type": "timestamp",
  541. "primaryKey": false,
  542. "notNull": true,
  543. "default": "now()"
  544. }
  545. },
  546. "indexes": {},
  547. "foreignKeys": {
  548. "acl_rules_resource_id_resources_id_fk": {
  549. "name": "acl_rules_resource_id_resources_id_fk",
  550. "tableFrom": "acl_rules",
  551. "tableTo": "resources",
  552. "columnsFrom": [
  553. "resource_id"
  554. ],
  555. "columnsTo": [
  556. "id"
  557. ],
  558. "onDelete": "cascade",
  559. "onUpdate": "no action"
  560. }
  561. },
  562. "compositePrimaryKeys": {},
  563. "uniqueConstraints": {},
  564. "policies": {},
  565. "checkConstraints": {},
  566. "isRLSEnabled": false
  567. },
  568. "public.resources": {
  569. "name": "resources",
  570. "schema": "",
  571. "columns": {
  572. "id": {
  573. "name": "id",
  574. "type": "uuid",
  575. "primaryKey": true,
  576. "notNull": true,
  577. "default": "gen_random_uuid()"
  578. },
  579. "name": {
  580. "name": "name",
  581. "type": "varchar(255)",
  582. "primaryKey": false,
  583. "notNull": true
  584. },
  585. "path": {
  586. "name": "path",
  587. "type": "text",
  588. "primaryKey": false,
  589. "notNull": true
  590. },
  591. "type": {
  592. "name": "type",
  593. "type": "varchar(50)",
  594. "primaryKey": false,
  595. "notNull": true
  596. },
  597. "owner_id": {
  598. "name": "owner_id",
  599. "type": "uuid",
  600. "primaryKey": false,
  601. "notNull": false
  602. },
  603. "created_at": {
  604. "name": "created_at",
  605. "type": "timestamp",
  606. "primaryKey": false,
  607. "notNull": true,
  608. "default": "now()"
  609. },
  610. "updated_at": {
  611. "name": "updated_at",
  612. "type": "timestamp",
  613. "primaryKey": false,
  614. "notNull": true,
  615. "default": "now()"
  616. }
  617. },
  618. "indexes": {},
  619. "foreignKeys": {
  620. "resources_owner_id_users_id_fk": {
  621. "name": "resources_owner_id_users_id_fk",
  622. "tableFrom": "resources",
  623. "tableTo": "users",
  624. "columnsFrom": [
  625. "owner_id"
  626. ],
  627. "columnsTo": [
  628. "id"
  629. ],
  630. "onDelete": "set null",
  631. "onUpdate": "no action"
  632. }
  633. },
  634. "compositePrimaryKeys": {},
  635. "uniqueConstraints": {
  636. "resources_path_unique": {
  637. "name": "resources_path_unique",
  638. "nullsNotDistinct": false,
  639. "columns": [
  640. "path"
  641. ]
  642. }
  643. },
  644. "policies": {},
  645. "checkConstraints": {},
  646. "isRLSEnabled": false
  647. }
  648. },
  649. "enums": {},
  650. "schemas": {},
  651. "sequences": {},
  652. "roles": {},
  653. "policies": {},
  654. "views": {},
  655. "_meta": {
  656. "columns": {},
  657. "schemas": {},
  658. "tables": {}
  659. }
  660. }