0001_snapshot.json 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751
  1. {
  2. "id": "a52e7c22-a395-4c42-b9eb-2093435413bb",
  3. "prevId": "0dec0586-cf88-4f21-84bf-aaf73e14e71b",
  4. "version": "7",
  5. "dialect": "postgresql",
  6. "tables": {
  7. "public.attendance": {
  8. "name": "attendance",
  9. "schema": "",
  10. "columns": {
  11. "id": {
  12. "name": "id",
  13. "type": "uuid",
  14. "primaryKey": true,
  15. "notNull": true,
  16. "default": "gen_random_uuid()"
  17. },
  18. "student_id": {
  19. "name": "student_id",
  20. "type": "uuid",
  21. "primaryKey": false,
  22. "notNull": false
  23. },
  24. "class_id": {
  25. "name": "class_id",
  26. "type": "uuid",
  27. "primaryKey": false,
  28. "notNull": false
  29. },
  30. "section_id": {
  31. "name": "section_id",
  32. "type": "uuid",
  33. "primaryKey": false,
  34. "notNull": false
  35. },
  36. "teacher_id": {
  37. "name": "teacher_id",
  38. "type": "uuid",
  39. "primaryKey": false,
  40. "notNull": false
  41. },
  42. "partial_id": {
  43. "name": "partial_id",
  44. "type": "uuid",
  45. "primaryKey": false,
  46. "notNull": false
  47. },
  48. "date": {
  49. "name": "date",
  50. "type": "date",
  51. "primaryKey": false,
  52. "notNull": true
  53. },
  54. "status": {
  55. "name": "status",
  56. "type": "varchar(20)",
  57. "primaryKey": false,
  58. "notNull": true
  59. },
  60. "reason": {
  61. "name": "reason",
  62. "type": "text",
  63. "primaryKey": false,
  64. "notNull": false
  65. },
  66. "created_at": {
  67. "name": "created_at",
  68. "type": "timestamp",
  69. "primaryKey": false,
  70. "notNull": false,
  71. "default": "now()"
  72. }
  73. },
  74. "indexes": {},
  75. "foreignKeys": {
  76. "attendance_student_id_users_id_fk": {
  77. "name": "attendance_student_id_users_id_fk",
  78. "tableFrom": "attendance",
  79. "tableTo": "users",
  80. "columnsFrom": [
  81. "student_id"
  82. ],
  83. "columnsTo": [
  84. "id"
  85. ],
  86. "onDelete": "no action",
  87. "onUpdate": "no action"
  88. },
  89. "attendance_class_id_classes_id_fk": {
  90. "name": "attendance_class_id_classes_id_fk",
  91. "tableFrom": "attendance",
  92. "tableTo": "classes",
  93. "columnsFrom": [
  94. "class_id"
  95. ],
  96. "columnsTo": [
  97. "id"
  98. ],
  99. "onDelete": "no action",
  100. "onUpdate": "no action"
  101. },
  102. "attendance_section_id_sections_id_fk": {
  103. "name": "attendance_section_id_sections_id_fk",
  104. "tableFrom": "attendance",
  105. "tableTo": "sections",
  106. "columnsFrom": [
  107. "section_id"
  108. ],
  109. "columnsTo": [
  110. "id"
  111. ],
  112. "onDelete": "no action",
  113. "onUpdate": "no action"
  114. },
  115. "attendance_teacher_id_users_id_fk": {
  116. "name": "attendance_teacher_id_users_id_fk",
  117. "tableFrom": "attendance",
  118. "tableTo": "users",
  119. "columnsFrom": [
  120. "teacher_id"
  121. ],
  122. "columnsTo": [
  123. "id"
  124. ],
  125. "onDelete": "no action",
  126. "onUpdate": "no action"
  127. },
  128. "attendance_partial_id_partials_id_fk": {
  129. "name": "attendance_partial_id_partials_id_fk",
  130. "tableFrom": "attendance",
  131. "tableTo": "partials",
  132. "columnsFrom": [
  133. "partial_id"
  134. ],
  135. "columnsTo": [
  136. "id"
  137. ],
  138. "onDelete": "no action",
  139. "onUpdate": "no action"
  140. }
  141. },
  142. "compositePrimaryKeys": {},
  143. "uniqueConstraints": {},
  144. "policies": {},
  145. "checkConstraints": {},
  146. "isRLSEnabled": false
  147. },
  148. "public.classes": {
  149. "name": "classes",
  150. "schema": "",
  151. "columns": {
  152. "id": {
  153. "name": "id",
  154. "type": "uuid",
  155. "primaryKey": true,
  156. "notNull": true,
  157. "default": "gen_random_uuid()"
  158. },
  159. "name": {
  160. "name": "name",
  161. "type": "varchar(100)",
  162. "primaryKey": false,
  163. "notNull": true
  164. },
  165. "code": {
  166. "name": "code",
  167. "type": "varchar(20)",
  168. "primaryKey": false,
  169. "notNull": true
  170. },
  171. "credits": {
  172. "name": "credits",
  173. "type": "integer",
  174. "primaryKey": false,
  175. "notNull": true
  176. },
  177. "description": {
  178. "name": "description",
  179. "type": "text",
  180. "primaryKey": false,
  181. "notNull": false
  182. },
  183. "is_active": {
  184. "name": "is_active",
  185. "type": "boolean",
  186. "primaryKey": false,
  187. "notNull": false,
  188. "default": true
  189. },
  190. "created_at": {
  191. "name": "created_at",
  192. "type": "timestamp",
  193. "primaryKey": false,
  194. "notNull": false,
  195. "default": "now()"
  196. },
  197. "updated_at": {
  198. "name": "updated_at",
  199. "type": "timestamp",
  200. "primaryKey": false,
  201. "notNull": false,
  202. "default": "now()"
  203. }
  204. },
  205. "indexes": {},
  206. "foreignKeys": {},
  207. "compositePrimaryKeys": {},
  208. "uniqueConstraints": {
  209. "classes_code_unique": {
  210. "name": "classes_code_unique",
  211. "nullsNotDistinct": false,
  212. "columns": [
  213. "code"
  214. ]
  215. }
  216. },
  217. "policies": {},
  218. "checkConstraints": {},
  219. "isRLSEnabled": false
  220. },
  221. "public.partials": {
  222. "name": "partials",
  223. "schema": "",
  224. "columns": {
  225. "id": {
  226. "name": "id",
  227. "type": "uuid",
  228. "primaryKey": true,
  229. "notNull": true,
  230. "default": "gen_random_uuid()"
  231. },
  232. "name": {
  233. "name": "name",
  234. "type": "varchar(100)",
  235. "primaryKey": false,
  236. "notNull": true
  237. },
  238. "period_id": {
  239. "name": "period_id",
  240. "type": "uuid",
  241. "primaryKey": false,
  242. "notNull": false
  243. },
  244. "start_date": {
  245. "name": "start_date",
  246. "type": "date",
  247. "primaryKey": false,
  248. "notNull": true
  249. },
  250. "end_date": {
  251. "name": "end_date",
  252. "type": "date",
  253. "primaryKey": false,
  254. "notNull": true
  255. },
  256. "is_active": {
  257. "name": "is_active",
  258. "type": "boolean",
  259. "primaryKey": false,
  260. "notNull": false,
  261. "default": true
  262. },
  263. "created_at": {
  264. "name": "created_at",
  265. "type": "timestamp",
  266. "primaryKey": false,
  267. "notNull": false,
  268. "default": "now()"
  269. },
  270. "updated_at": {
  271. "name": "updated_at",
  272. "type": "timestamp",
  273. "primaryKey": false,
  274. "notNull": false,
  275. "default": "now()"
  276. }
  277. },
  278. "indexes": {},
  279. "foreignKeys": {
  280. "partials_period_id_periods_id_fk": {
  281. "name": "partials_period_id_periods_id_fk",
  282. "tableFrom": "partials",
  283. "tableTo": "periods",
  284. "columnsFrom": [
  285. "period_id"
  286. ],
  287. "columnsTo": [
  288. "id"
  289. ],
  290. "onDelete": "no action",
  291. "onUpdate": "no action"
  292. }
  293. },
  294. "compositePrimaryKeys": {},
  295. "uniqueConstraints": {},
  296. "policies": {},
  297. "checkConstraints": {},
  298. "isRLSEnabled": false
  299. },
  300. "public.periods": {
  301. "name": "periods",
  302. "schema": "",
  303. "columns": {
  304. "id": {
  305. "name": "id",
  306. "type": "uuid",
  307. "primaryKey": true,
  308. "notNull": true,
  309. "default": "gen_random_uuid()"
  310. },
  311. "name": {
  312. "name": "name",
  313. "type": "varchar(100)",
  314. "primaryKey": false,
  315. "notNull": true
  316. },
  317. "start_date": {
  318. "name": "start_date",
  319. "type": "date",
  320. "primaryKey": false,
  321. "notNull": true
  322. },
  323. "end_date": {
  324. "name": "end_date",
  325. "type": "date",
  326. "primaryKey": false,
  327. "notNull": true
  328. },
  329. "is_active": {
  330. "name": "is_active",
  331. "type": "boolean",
  332. "primaryKey": false,
  333. "notNull": false,
  334. "default": true
  335. },
  336. "created_at": {
  337. "name": "created_at",
  338. "type": "timestamp",
  339. "primaryKey": false,
  340. "notNull": false,
  341. "default": "now()"
  342. },
  343. "updated_at": {
  344. "name": "updated_at",
  345. "type": "timestamp",
  346. "primaryKey": false,
  347. "notNull": false,
  348. "default": "now()"
  349. }
  350. },
  351. "indexes": {},
  352. "foreignKeys": {},
  353. "compositePrimaryKeys": {},
  354. "uniqueConstraints": {},
  355. "policies": {},
  356. "checkConstraints": {},
  357. "isRLSEnabled": false
  358. },
  359. "public.sections": {
  360. "name": "sections",
  361. "schema": "",
  362. "columns": {
  363. "id": {
  364. "name": "id",
  365. "type": "uuid",
  366. "primaryKey": true,
  367. "notNull": true,
  368. "default": "gen_random_uuid()"
  369. },
  370. "name": {
  371. "name": "name",
  372. "type": "varchar(50)",
  373. "primaryKey": false,
  374. "notNull": true
  375. },
  376. "class_id": {
  377. "name": "class_id",
  378. "type": "uuid",
  379. "primaryKey": false,
  380. "notNull": false
  381. },
  382. "period_id": {
  383. "name": "period_id",
  384. "type": "uuid",
  385. "primaryKey": false,
  386. "notNull": false
  387. },
  388. "max_students": {
  389. "name": "max_students",
  390. "type": "integer",
  391. "primaryKey": false,
  392. "notNull": true
  393. },
  394. "is_active": {
  395. "name": "is_active",
  396. "type": "boolean",
  397. "primaryKey": false,
  398. "notNull": false,
  399. "default": true
  400. },
  401. "created_at": {
  402. "name": "created_at",
  403. "type": "timestamp",
  404. "primaryKey": false,
  405. "notNull": false,
  406. "default": "now()"
  407. },
  408. "updated_at": {
  409. "name": "updated_at",
  410. "type": "timestamp",
  411. "primaryKey": false,
  412. "notNull": false,
  413. "default": "now()"
  414. }
  415. },
  416. "indexes": {},
  417. "foreignKeys": {
  418. "sections_class_id_classes_id_fk": {
  419. "name": "sections_class_id_classes_id_fk",
  420. "tableFrom": "sections",
  421. "tableTo": "classes",
  422. "columnsFrom": [
  423. "class_id"
  424. ],
  425. "columnsTo": [
  426. "id"
  427. ],
  428. "onDelete": "no action",
  429. "onUpdate": "no action"
  430. },
  431. "sections_period_id_periods_id_fk": {
  432. "name": "sections_period_id_periods_id_fk",
  433. "tableFrom": "sections",
  434. "tableTo": "periods",
  435. "columnsFrom": [
  436. "period_id"
  437. ],
  438. "columnsTo": [
  439. "id"
  440. ],
  441. "onDelete": "no action",
  442. "onUpdate": "no action"
  443. }
  444. },
  445. "compositePrimaryKeys": {},
  446. "uniqueConstraints": {},
  447. "policies": {},
  448. "checkConstraints": {},
  449. "isRLSEnabled": false
  450. },
  451. "public.student_enrollments": {
  452. "name": "student_enrollments",
  453. "schema": "",
  454. "columns": {
  455. "id": {
  456. "name": "id",
  457. "type": "uuid",
  458. "primaryKey": true,
  459. "notNull": true,
  460. "default": "gen_random_uuid()"
  461. },
  462. "student_id": {
  463. "name": "student_id",
  464. "type": "uuid",
  465. "primaryKey": false,
  466. "notNull": false
  467. },
  468. "class_id": {
  469. "name": "class_id",
  470. "type": "uuid",
  471. "primaryKey": false,
  472. "notNull": false
  473. },
  474. "section_id": {
  475. "name": "section_id",
  476. "type": "uuid",
  477. "primaryKey": false,
  478. "notNull": false
  479. },
  480. "is_active": {
  481. "name": "is_active",
  482. "type": "boolean",
  483. "primaryKey": false,
  484. "notNull": false,
  485. "default": true
  486. },
  487. "created_at": {
  488. "name": "created_at",
  489. "type": "timestamp",
  490. "primaryKey": false,
  491. "notNull": false,
  492. "default": "now()"
  493. }
  494. },
  495. "indexes": {},
  496. "foreignKeys": {
  497. "student_enrollments_student_id_users_id_fk": {
  498. "name": "student_enrollments_student_id_users_id_fk",
  499. "tableFrom": "student_enrollments",
  500. "tableTo": "users",
  501. "columnsFrom": [
  502. "student_id"
  503. ],
  504. "columnsTo": [
  505. "id"
  506. ],
  507. "onDelete": "no action",
  508. "onUpdate": "no action"
  509. },
  510. "student_enrollments_class_id_classes_id_fk": {
  511. "name": "student_enrollments_class_id_classes_id_fk",
  512. "tableFrom": "student_enrollments",
  513. "tableTo": "classes",
  514. "columnsFrom": [
  515. "class_id"
  516. ],
  517. "columnsTo": [
  518. "id"
  519. ],
  520. "onDelete": "no action",
  521. "onUpdate": "no action"
  522. },
  523. "student_enrollments_section_id_sections_id_fk": {
  524. "name": "student_enrollments_section_id_sections_id_fk",
  525. "tableFrom": "student_enrollments",
  526. "tableTo": "sections",
  527. "columnsFrom": [
  528. "section_id"
  529. ],
  530. "columnsTo": [
  531. "id"
  532. ],
  533. "onDelete": "no action",
  534. "onUpdate": "no action"
  535. }
  536. },
  537. "compositePrimaryKeys": {},
  538. "uniqueConstraints": {},
  539. "policies": {},
  540. "checkConstraints": {},
  541. "isRLSEnabled": false
  542. },
  543. "public.teacher_assignments": {
  544. "name": "teacher_assignments",
  545. "schema": "",
  546. "columns": {
  547. "id": {
  548. "name": "id",
  549. "type": "uuid",
  550. "primaryKey": true,
  551. "notNull": true,
  552. "default": "gen_random_uuid()"
  553. },
  554. "teacher_id": {
  555. "name": "teacher_id",
  556. "type": "uuid",
  557. "primaryKey": false,
  558. "notNull": false
  559. },
  560. "class_id": {
  561. "name": "class_id",
  562. "type": "uuid",
  563. "primaryKey": false,
  564. "notNull": false
  565. },
  566. "section_id": {
  567. "name": "section_id",
  568. "type": "uuid",
  569. "primaryKey": false,
  570. "notNull": false
  571. },
  572. "is_active": {
  573. "name": "is_active",
  574. "type": "boolean",
  575. "primaryKey": false,
  576. "notNull": false,
  577. "default": true
  578. },
  579. "created_at": {
  580. "name": "created_at",
  581. "type": "timestamp",
  582. "primaryKey": false,
  583. "notNull": false,
  584. "default": "now()"
  585. }
  586. },
  587. "indexes": {},
  588. "foreignKeys": {
  589. "teacher_assignments_teacher_id_users_id_fk": {
  590. "name": "teacher_assignments_teacher_id_users_id_fk",
  591. "tableFrom": "teacher_assignments",
  592. "tableTo": "users",
  593. "columnsFrom": [
  594. "teacher_id"
  595. ],
  596. "columnsTo": [
  597. "id"
  598. ],
  599. "onDelete": "no action",
  600. "onUpdate": "no action"
  601. },
  602. "teacher_assignments_class_id_classes_id_fk": {
  603. "name": "teacher_assignments_class_id_classes_id_fk",
  604. "tableFrom": "teacher_assignments",
  605. "tableTo": "classes",
  606. "columnsFrom": [
  607. "class_id"
  608. ],
  609. "columnsTo": [
  610. "id"
  611. ],
  612. "onDelete": "no action",
  613. "onUpdate": "no action"
  614. },
  615. "teacher_assignments_section_id_sections_id_fk": {
  616. "name": "teacher_assignments_section_id_sections_id_fk",
  617. "tableFrom": "teacher_assignments",
  618. "tableTo": "sections",
  619. "columnsFrom": [
  620. "section_id"
  621. ],
  622. "columnsTo": [
  623. "id"
  624. ],
  625. "onDelete": "no action",
  626. "onUpdate": "no action"
  627. }
  628. },
  629. "compositePrimaryKeys": {},
  630. "uniqueConstraints": {},
  631. "policies": {},
  632. "checkConstraints": {},
  633. "isRLSEnabled": false
  634. },
  635. "public.users": {
  636. "name": "users",
  637. "schema": "",
  638. "columns": {
  639. "id": {
  640. "name": "id",
  641. "type": "uuid",
  642. "primaryKey": true,
  643. "notNull": true,
  644. "default": "gen_random_uuid()"
  645. },
  646. "email": {
  647. "name": "email",
  648. "type": "varchar(255)",
  649. "primaryKey": false,
  650. "notNull": true
  651. },
  652. "password": {
  653. "name": "password",
  654. "type": "text",
  655. "primaryKey": false,
  656. "notNull": true
  657. },
  658. "first_name": {
  659. "name": "first_name",
  660. "type": "varchar(100)",
  661. "primaryKey": false,
  662. "notNull": true
  663. },
  664. "last_name": {
  665. "name": "last_name",
  666. "type": "varchar(100)",
  667. "primaryKey": false,
  668. "notNull": true
  669. },
  670. "cedula": {
  671. "name": "cedula",
  672. "type": "varchar(20)",
  673. "primaryKey": false,
  674. "notNull": true
  675. },
  676. "phone": {
  677. "name": "phone",
  678. "type": "varchar(20)",
  679. "primaryKey": false,
  680. "notNull": false
  681. },
  682. "role": {
  683. "name": "role",
  684. "type": "varchar(20)",
  685. "primaryKey": false,
  686. "notNull": true
  687. },
  688. "admission_number": {
  689. "name": "admission_number",
  690. "type": "varchar(50)",
  691. "primaryKey": false,
  692. "notNull": false
  693. },
  694. "is_active": {
  695. "name": "is_active",
  696. "type": "boolean",
  697. "primaryKey": false,
  698. "notNull": false,
  699. "default": true
  700. },
  701. "created_at": {
  702. "name": "created_at",
  703. "type": "timestamp",
  704. "primaryKey": false,
  705. "notNull": false,
  706. "default": "now()"
  707. },
  708. "updated_at": {
  709. "name": "updated_at",
  710. "type": "timestamp",
  711. "primaryKey": false,
  712. "notNull": false,
  713. "default": "now()"
  714. }
  715. },
  716. "indexes": {},
  717. "foreignKeys": {},
  718. "compositePrimaryKeys": {},
  719. "uniqueConstraints": {
  720. "users_email_unique": {
  721. "name": "users_email_unique",
  722. "nullsNotDistinct": false,
  723. "columns": [
  724. "email"
  725. ]
  726. },
  727. "users_cedula_unique": {
  728. "name": "users_cedula_unique",
  729. "nullsNotDistinct": false,
  730. "columns": [
  731. "cedula"
  732. ]
  733. }
  734. },
  735. "policies": {},
  736. "checkConstraints": {},
  737. "isRLSEnabled": false
  738. }
  739. },
  740. "enums": {},
  741. "schemas": {},
  742. "sequences": {},
  743. "roles": {},
  744. "policies": {},
  745. "views": {},
  746. "_meta": {
  747. "columns": {},
  748. "schemas": {},
  749. "tables": {}
  750. }
  751. }