0002_snapshot.json 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771
  1. {
  2. "id": "689081c0-94c4-4c90-a1ee-ccdce86fbe77",
  3. "prevId": "a52e7c22-a395-4c42-b9eb-2093435413bb",
  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. "period_id": {
  184. "name": "period_id",
  185. "type": "uuid",
  186. "primaryKey": false,
  187. "notNull": false
  188. },
  189. "is_active": {
  190. "name": "is_active",
  191. "type": "boolean",
  192. "primaryKey": false,
  193. "notNull": false,
  194. "default": true
  195. },
  196. "created_at": {
  197. "name": "created_at",
  198. "type": "timestamp",
  199. "primaryKey": false,
  200. "notNull": false,
  201. "default": "now()"
  202. },
  203. "updated_at": {
  204. "name": "updated_at",
  205. "type": "timestamp",
  206. "primaryKey": false,
  207. "notNull": false,
  208. "default": "now()"
  209. }
  210. },
  211. "indexes": {},
  212. "foreignKeys": {
  213. "classes_period_id_periods_id_fk": {
  214. "name": "classes_period_id_periods_id_fk",
  215. "tableFrom": "classes",
  216. "tableTo": "periods",
  217. "columnsFrom": [
  218. "period_id"
  219. ],
  220. "columnsTo": [
  221. "id"
  222. ],
  223. "onDelete": "no action",
  224. "onUpdate": "no action"
  225. }
  226. },
  227. "compositePrimaryKeys": {},
  228. "uniqueConstraints": {
  229. "classes_code_unique": {
  230. "name": "classes_code_unique",
  231. "nullsNotDistinct": false,
  232. "columns": [
  233. "code"
  234. ]
  235. }
  236. },
  237. "policies": {},
  238. "checkConstraints": {},
  239. "isRLSEnabled": false
  240. },
  241. "public.partials": {
  242. "name": "partials",
  243. "schema": "",
  244. "columns": {
  245. "id": {
  246. "name": "id",
  247. "type": "uuid",
  248. "primaryKey": true,
  249. "notNull": true,
  250. "default": "gen_random_uuid()"
  251. },
  252. "name": {
  253. "name": "name",
  254. "type": "varchar(100)",
  255. "primaryKey": false,
  256. "notNull": true
  257. },
  258. "period_id": {
  259. "name": "period_id",
  260. "type": "uuid",
  261. "primaryKey": false,
  262. "notNull": false
  263. },
  264. "start_date": {
  265. "name": "start_date",
  266. "type": "date",
  267. "primaryKey": false,
  268. "notNull": true
  269. },
  270. "end_date": {
  271. "name": "end_date",
  272. "type": "date",
  273. "primaryKey": false,
  274. "notNull": true
  275. },
  276. "is_active": {
  277. "name": "is_active",
  278. "type": "boolean",
  279. "primaryKey": false,
  280. "notNull": false,
  281. "default": true
  282. },
  283. "created_at": {
  284. "name": "created_at",
  285. "type": "timestamp",
  286. "primaryKey": false,
  287. "notNull": false,
  288. "default": "now()"
  289. },
  290. "updated_at": {
  291. "name": "updated_at",
  292. "type": "timestamp",
  293. "primaryKey": false,
  294. "notNull": false,
  295. "default": "now()"
  296. }
  297. },
  298. "indexes": {},
  299. "foreignKeys": {
  300. "partials_period_id_periods_id_fk": {
  301. "name": "partials_period_id_periods_id_fk",
  302. "tableFrom": "partials",
  303. "tableTo": "periods",
  304. "columnsFrom": [
  305. "period_id"
  306. ],
  307. "columnsTo": [
  308. "id"
  309. ],
  310. "onDelete": "no action",
  311. "onUpdate": "no action"
  312. }
  313. },
  314. "compositePrimaryKeys": {},
  315. "uniqueConstraints": {},
  316. "policies": {},
  317. "checkConstraints": {},
  318. "isRLSEnabled": false
  319. },
  320. "public.periods": {
  321. "name": "periods",
  322. "schema": "",
  323. "columns": {
  324. "id": {
  325. "name": "id",
  326. "type": "uuid",
  327. "primaryKey": true,
  328. "notNull": true,
  329. "default": "gen_random_uuid()"
  330. },
  331. "name": {
  332. "name": "name",
  333. "type": "varchar(100)",
  334. "primaryKey": false,
  335. "notNull": true
  336. },
  337. "start_date": {
  338. "name": "start_date",
  339. "type": "date",
  340. "primaryKey": false,
  341. "notNull": true
  342. },
  343. "end_date": {
  344. "name": "end_date",
  345. "type": "date",
  346. "primaryKey": false,
  347. "notNull": true
  348. },
  349. "is_active": {
  350. "name": "is_active",
  351. "type": "boolean",
  352. "primaryKey": false,
  353. "notNull": false,
  354. "default": true
  355. },
  356. "created_at": {
  357. "name": "created_at",
  358. "type": "timestamp",
  359. "primaryKey": false,
  360. "notNull": false,
  361. "default": "now()"
  362. },
  363. "updated_at": {
  364. "name": "updated_at",
  365. "type": "timestamp",
  366. "primaryKey": false,
  367. "notNull": false,
  368. "default": "now()"
  369. }
  370. },
  371. "indexes": {},
  372. "foreignKeys": {},
  373. "compositePrimaryKeys": {},
  374. "uniqueConstraints": {},
  375. "policies": {},
  376. "checkConstraints": {},
  377. "isRLSEnabled": false
  378. },
  379. "public.sections": {
  380. "name": "sections",
  381. "schema": "",
  382. "columns": {
  383. "id": {
  384. "name": "id",
  385. "type": "uuid",
  386. "primaryKey": true,
  387. "notNull": true,
  388. "default": "gen_random_uuid()"
  389. },
  390. "name": {
  391. "name": "name",
  392. "type": "varchar(50)",
  393. "primaryKey": false,
  394. "notNull": true
  395. },
  396. "class_id": {
  397. "name": "class_id",
  398. "type": "uuid",
  399. "primaryKey": false,
  400. "notNull": false
  401. },
  402. "period_id": {
  403. "name": "period_id",
  404. "type": "uuid",
  405. "primaryKey": false,
  406. "notNull": false
  407. },
  408. "max_students": {
  409. "name": "max_students",
  410. "type": "integer",
  411. "primaryKey": false,
  412. "notNull": true
  413. },
  414. "is_active": {
  415. "name": "is_active",
  416. "type": "boolean",
  417. "primaryKey": false,
  418. "notNull": false,
  419. "default": true
  420. },
  421. "created_at": {
  422. "name": "created_at",
  423. "type": "timestamp",
  424. "primaryKey": false,
  425. "notNull": false,
  426. "default": "now()"
  427. },
  428. "updated_at": {
  429. "name": "updated_at",
  430. "type": "timestamp",
  431. "primaryKey": false,
  432. "notNull": false,
  433. "default": "now()"
  434. }
  435. },
  436. "indexes": {},
  437. "foreignKeys": {
  438. "sections_class_id_classes_id_fk": {
  439. "name": "sections_class_id_classes_id_fk",
  440. "tableFrom": "sections",
  441. "tableTo": "classes",
  442. "columnsFrom": [
  443. "class_id"
  444. ],
  445. "columnsTo": [
  446. "id"
  447. ],
  448. "onDelete": "no action",
  449. "onUpdate": "no action"
  450. },
  451. "sections_period_id_periods_id_fk": {
  452. "name": "sections_period_id_periods_id_fk",
  453. "tableFrom": "sections",
  454. "tableTo": "periods",
  455. "columnsFrom": [
  456. "period_id"
  457. ],
  458. "columnsTo": [
  459. "id"
  460. ],
  461. "onDelete": "no action",
  462. "onUpdate": "no action"
  463. }
  464. },
  465. "compositePrimaryKeys": {},
  466. "uniqueConstraints": {},
  467. "policies": {},
  468. "checkConstraints": {},
  469. "isRLSEnabled": false
  470. },
  471. "public.student_enrollments": {
  472. "name": "student_enrollments",
  473. "schema": "",
  474. "columns": {
  475. "id": {
  476. "name": "id",
  477. "type": "uuid",
  478. "primaryKey": true,
  479. "notNull": true,
  480. "default": "gen_random_uuid()"
  481. },
  482. "student_id": {
  483. "name": "student_id",
  484. "type": "uuid",
  485. "primaryKey": false,
  486. "notNull": false
  487. },
  488. "class_id": {
  489. "name": "class_id",
  490. "type": "uuid",
  491. "primaryKey": false,
  492. "notNull": false
  493. },
  494. "section_id": {
  495. "name": "section_id",
  496. "type": "uuid",
  497. "primaryKey": false,
  498. "notNull": false
  499. },
  500. "is_active": {
  501. "name": "is_active",
  502. "type": "boolean",
  503. "primaryKey": false,
  504. "notNull": false,
  505. "default": true
  506. },
  507. "created_at": {
  508. "name": "created_at",
  509. "type": "timestamp",
  510. "primaryKey": false,
  511. "notNull": false,
  512. "default": "now()"
  513. }
  514. },
  515. "indexes": {},
  516. "foreignKeys": {
  517. "student_enrollments_student_id_users_id_fk": {
  518. "name": "student_enrollments_student_id_users_id_fk",
  519. "tableFrom": "student_enrollments",
  520. "tableTo": "users",
  521. "columnsFrom": [
  522. "student_id"
  523. ],
  524. "columnsTo": [
  525. "id"
  526. ],
  527. "onDelete": "no action",
  528. "onUpdate": "no action"
  529. },
  530. "student_enrollments_class_id_classes_id_fk": {
  531. "name": "student_enrollments_class_id_classes_id_fk",
  532. "tableFrom": "student_enrollments",
  533. "tableTo": "classes",
  534. "columnsFrom": [
  535. "class_id"
  536. ],
  537. "columnsTo": [
  538. "id"
  539. ],
  540. "onDelete": "no action",
  541. "onUpdate": "no action"
  542. },
  543. "student_enrollments_section_id_sections_id_fk": {
  544. "name": "student_enrollments_section_id_sections_id_fk",
  545. "tableFrom": "student_enrollments",
  546. "tableTo": "sections",
  547. "columnsFrom": [
  548. "section_id"
  549. ],
  550. "columnsTo": [
  551. "id"
  552. ],
  553. "onDelete": "no action",
  554. "onUpdate": "no action"
  555. }
  556. },
  557. "compositePrimaryKeys": {},
  558. "uniqueConstraints": {},
  559. "policies": {},
  560. "checkConstraints": {},
  561. "isRLSEnabled": false
  562. },
  563. "public.teacher_assignments": {
  564. "name": "teacher_assignments",
  565. "schema": "",
  566. "columns": {
  567. "id": {
  568. "name": "id",
  569. "type": "uuid",
  570. "primaryKey": true,
  571. "notNull": true,
  572. "default": "gen_random_uuid()"
  573. },
  574. "teacher_id": {
  575. "name": "teacher_id",
  576. "type": "uuid",
  577. "primaryKey": false,
  578. "notNull": false
  579. },
  580. "class_id": {
  581. "name": "class_id",
  582. "type": "uuid",
  583. "primaryKey": false,
  584. "notNull": false
  585. },
  586. "section_id": {
  587. "name": "section_id",
  588. "type": "uuid",
  589. "primaryKey": false,
  590. "notNull": false
  591. },
  592. "is_active": {
  593. "name": "is_active",
  594. "type": "boolean",
  595. "primaryKey": false,
  596. "notNull": false,
  597. "default": true
  598. },
  599. "created_at": {
  600. "name": "created_at",
  601. "type": "timestamp",
  602. "primaryKey": false,
  603. "notNull": false,
  604. "default": "now()"
  605. }
  606. },
  607. "indexes": {},
  608. "foreignKeys": {
  609. "teacher_assignments_teacher_id_users_id_fk": {
  610. "name": "teacher_assignments_teacher_id_users_id_fk",
  611. "tableFrom": "teacher_assignments",
  612. "tableTo": "users",
  613. "columnsFrom": [
  614. "teacher_id"
  615. ],
  616. "columnsTo": [
  617. "id"
  618. ],
  619. "onDelete": "no action",
  620. "onUpdate": "no action"
  621. },
  622. "teacher_assignments_class_id_classes_id_fk": {
  623. "name": "teacher_assignments_class_id_classes_id_fk",
  624. "tableFrom": "teacher_assignments",
  625. "tableTo": "classes",
  626. "columnsFrom": [
  627. "class_id"
  628. ],
  629. "columnsTo": [
  630. "id"
  631. ],
  632. "onDelete": "no action",
  633. "onUpdate": "no action"
  634. },
  635. "teacher_assignments_section_id_sections_id_fk": {
  636. "name": "teacher_assignments_section_id_sections_id_fk",
  637. "tableFrom": "teacher_assignments",
  638. "tableTo": "sections",
  639. "columnsFrom": [
  640. "section_id"
  641. ],
  642. "columnsTo": [
  643. "id"
  644. ],
  645. "onDelete": "no action",
  646. "onUpdate": "no action"
  647. }
  648. },
  649. "compositePrimaryKeys": {},
  650. "uniqueConstraints": {},
  651. "policies": {},
  652. "checkConstraints": {},
  653. "isRLSEnabled": false
  654. },
  655. "public.users": {
  656. "name": "users",
  657. "schema": "",
  658. "columns": {
  659. "id": {
  660. "name": "id",
  661. "type": "uuid",
  662. "primaryKey": true,
  663. "notNull": true,
  664. "default": "gen_random_uuid()"
  665. },
  666. "email": {
  667. "name": "email",
  668. "type": "varchar(255)",
  669. "primaryKey": false,
  670. "notNull": true
  671. },
  672. "password": {
  673. "name": "password",
  674. "type": "text",
  675. "primaryKey": false,
  676. "notNull": true
  677. },
  678. "first_name": {
  679. "name": "first_name",
  680. "type": "varchar(100)",
  681. "primaryKey": false,
  682. "notNull": true
  683. },
  684. "last_name": {
  685. "name": "last_name",
  686. "type": "varchar(100)",
  687. "primaryKey": false,
  688. "notNull": true
  689. },
  690. "cedula": {
  691. "name": "cedula",
  692. "type": "varchar(20)",
  693. "primaryKey": false,
  694. "notNull": true
  695. },
  696. "phone": {
  697. "name": "phone",
  698. "type": "varchar(20)",
  699. "primaryKey": false,
  700. "notNull": false
  701. },
  702. "role": {
  703. "name": "role",
  704. "type": "varchar(20)",
  705. "primaryKey": false,
  706. "notNull": true
  707. },
  708. "admission_number": {
  709. "name": "admission_number",
  710. "type": "varchar(50)",
  711. "primaryKey": false,
  712. "notNull": false
  713. },
  714. "is_active": {
  715. "name": "is_active",
  716. "type": "boolean",
  717. "primaryKey": false,
  718. "notNull": false,
  719. "default": true
  720. },
  721. "created_at": {
  722. "name": "created_at",
  723. "type": "timestamp",
  724. "primaryKey": false,
  725. "notNull": false,
  726. "default": "now()"
  727. },
  728. "updated_at": {
  729. "name": "updated_at",
  730. "type": "timestamp",
  731. "primaryKey": false,
  732. "notNull": false,
  733. "default": "now()"
  734. }
  735. },
  736. "indexes": {},
  737. "foreignKeys": {},
  738. "compositePrimaryKeys": {},
  739. "uniqueConstraints": {
  740. "users_email_unique": {
  741. "name": "users_email_unique",
  742. "nullsNotDistinct": false,
  743. "columns": [
  744. "email"
  745. ]
  746. },
  747. "users_cedula_unique": {
  748. "name": "users_cedula_unique",
  749. "nullsNotDistinct": false,
  750. "columns": [
  751. "cedula"
  752. ]
  753. }
  754. },
  755. "policies": {},
  756. "checkConstraints": {},
  757. "isRLSEnabled": false
  758. }
  759. },
  760. "enums": {},
  761. "schemas": {},
  762. "sequences": {},
  763. "roles": {},
  764. "policies": {},
  765. "views": {},
  766. "_meta": {
  767. "columns": {},
  768. "schemas": {},
  769. "tables": {}
  770. }
  771. }