0003_snapshot.json 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752
  1. {
  2. "id": "6f4da49b-981a-4f9a-b990-14d457ea2111",
  3. "prevId": "689081c0-94c4-4c90-a1ee-ccdce86fbe77",
  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. "max_students": {
  403. "name": "max_students",
  404. "type": "integer",
  405. "primaryKey": false,
  406. "notNull": true
  407. },
  408. "is_active": {
  409. "name": "is_active",
  410. "type": "boolean",
  411. "primaryKey": false,
  412. "notNull": false,
  413. "default": true
  414. },
  415. "created_at": {
  416. "name": "created_at",
  417. "type": "timestamp",
  418. "primaryKey": false,
  419. "notNull": false,
  420. "default": "now()"
  421. },
  422. "updated_at": {
  423. "name": "updated_at",
  424. "type": "timestamp",
  425. "primaryKey": false,
  426. "notNull": false,
  427. "default": "now()"
  428. }
  429. },
  430. "indexes": {},
  431. "foreignKeys": {
  432. "sections_class_id_classes_id_fk": {
  433. "name": "sections_class_id_classes_id_fk",
  434. "tableFrom": "sections",
  435. "tableTo": "classes",
  436. "columnsFrom": [
  437. "class_id"
  438. ],
  439. "columnsTo": [
  440. "id"
  441. ],
  442. "onDelete": "no action",
  443. "onUpdate": "no action"
  444. }
  445. },
  446. "compositePrimaryKeys": {},
  447. "uniqueConstraints": {},
  448. "policies": {},
  449. "checkConstraints": {},
  450. "isRLSEnabled": false
  451. },
  452. "public.student_enrollments": {
  453. "name": "student_enrollments",
  454. "schema": "",
  455. "columns": {
  456. "id": {
  457. "name": "id",
  458. "type": "uuid",
  459. "primaryKey": true,
  460. "notNull": true,
  461. "default": "gen_random_uuid()"
  462. },
  463. "student_id": {
  464. "name": "student_id",
  465. "type": "uuid",
  466. "primaryKey": false,
  467. "notNull": false
  468. },
  469. "class_id": {
  470. "name": "class_id",
  471. "type": "uuid",
  472. "primaryKey": false,
  473. "notNull": false
  474. },
  475. "section_id": {
  476. "name": "section_id",
  477. "type": "uuid",
  478. "primaryKey": false,
  479. "notNull": false
  480. },
  481. "is_active": {
  482. "name": "is_active",
  483. "type": "boolean",
  484. "primaryKey": false,
  485. "notNull": false,
  486. "default": true
  487. },
  488. "created_at": {
  489. "name": "created_at",
  490. "type": "timestamp",
  491. "primaryKey": false,
  492. "notNull": false,
  493. "default": "now()"
  494. }
  495. },
  496. "indexes": {},
  497. "foreignKeys": {
  498. "student_enrollments_student_id_users_id_fk": {
  499. "name": "student_enrollments_student_id_users_id_fk",
  500. "tableFrom": "student_enrollments",
  501. "tableTo": "users",
  502. "columnsFrom": [
  503. "student_id"
  504. ],
  505. "columnsTo": [
  506. "id"
  507. ],
  508. "onDelete": "no action",
  509. "onUpdate": "no action"
  510. },
  511. "student_enrollments_class_id_classes_id_fk": {
  512. "name": "student_enrollments_class_id_classes_id_fk",
  513. "tableFrom": "student_enrollments",
  514. "tableTo": "classes",
  515. "columnsFrom": [
  516. "class_id"
  517. ],
  518. "columnsTo": [
  519. "id"
  520. ],
  521. "onDelete": "no action",
  522. "onUpdate": "no action"
  523. },
  524. "student_enrollments_section_id_sections_id_fk": {
  525. "name": "student_enrollments_section_id_sections_id_fk",
  526. "tableFrom": "student_enrollments",
  527. "tableTo": "sections",
  528. "columnsFrom": [
  529. "section_id"
  530. ],
  531. "columnsTo": [
  532. "id"
  533. ],
  534. "onDelete": "no action",
  535. "onUpdate": "no action"
  536. }
  537. },
  538. "compositePrimaryKeys": {},
  539. "uniqueConstraints": {},
  540. "policies": {},
  541. "checkConstraints": {},
  542. "isRLSEnabled": false
  543. },
  544. "public.teacher_assignments": {
  545. "name": "teacher_assignments",
  546. "schema": "",
  547. "columns": {
  548. "id": {
  549. "name": "id",
  550. "type": "uuid",
  551. "primaryKey": true,
  552. "notNull": true,
  553. "default": "gen_random_uuid()"
  554. },
  555. "teacher_id": {
  556. "name": "teacher_id",
  557. "type": "uuid",
  558. "primaryKey": false,
  559. "notNull": false
  560. },
  561. "class_id": {
  562. "name": "class_id",
  563. "type": "uuid",
  564. "primaryKey": false,
  565. "notNull": false
  566. },
  567. "section_id": {
  568. "name": "section_id",
  569. "type": "uuid",
  570. "primaryKey": false,
  571. "notNull": false
  572. },
  573. "is_active": {
  574. "name": "is_active",
  575. "type": "boolean",
  576. "primaryKey": false,
  577. "notNull": false,
  578. "default": true
  579. },
  580. "created_at": {
  581. "name": "created_at",
  582. "type": "timestamp",
  583. "primaryKey": false,
  584. "notNull": false,
  585. "default": "now()"
  586. }
  587. },
  588. "indexes": {},
  589. "foreignKeys": {
  590. "teacher_assignments_teacher_id_users_id_fk": {
  591. "name": "teacher_assignments_teacher_id_users_id_fk",
  592. "tableFrom": "teacher_assignments",
  593. "tableTo": "users",
  594. "columnsFrom": [
  595. "teacher_id"
  596. ],
  597. "columnsTo": [
  598. "id"
  599. ],
  600. "onDelete": "no action",
  601. "onUpdate": "no action"
  602. },
  603. "teacher_assignments_class_id_classes_id_fk": {
  604. "name": "teacher_assignments_class_id_classes_id_fk",
  605. "tableFrom": "teacher_assignments",
  606. "tableTo": "classes",
  607. "columnsFrom": [
  608. "class_id"
  609. ],
  610. "columnsTo": [
  611. "id"
  612. ],
  613. "onDelete": "no action",
  614. "onUpdate": "no action"
  615. },
  616. "teacher_assignments_section_id_sections_id_fk": {
  617. "name": "teacher_assignments_section_id_sections_id_fk",
  618. "tableFrom": "teacher_assignments",
  619. "tableTo": "sections",
  620. "columnsFrom": [
  621. "section_id"
  622. ],
  623. "columnsTo": [
  624. "id"
  625. ],
  626. "onDelete": "no action",
  627. "onUpdate": "no action"
  628. }
  629. },
  630. "compositePrimaryKeys": {},
  631. "uniqueConstraints": {},
  632. "policies": {},
  633. "checkConstraints": {},
  634. "isRLSEnabled": false
  635. },
  636. "public.users": {
  637. "name": "users",
  638. "schema": "",
  639. "columns": {
  640. "id": {
  641. "name": "id",
  642. "type": "uuid",
  643. "primaryKey": true,
  644. "notNull": true,
  645. "default": "gen_random_uuid()"
  646. },
  647. "email": {
  648. "name": "email",
  649. "type": "varchar(255)",
  650. "primaryKey": false,
  651. "notNull": true
  652. },
  653. "password": {
  654. "name": "password",
  655. "type": "text",
  656. "primaryKey": false,
  657. "notNull": true
  658. },
  659. "first_name": {
  660. "name": "first_name",
  661. "type": "varchar(100)",
  662. "primaryKey": false,
  663. "notNull": true
  664. },
  665. "last_name": {
  666. "name": "last_name",
  667. "type": "varchar(100)",
  668. "primaryKey": false,
  669. "notNull": true
  670. },
  671. "cedula": {
  672. "name": "cedula",
  673. "type": "varchar(20)",
  674. "primaryKey": false,
  675. "notNull": true
  676. },
  677. "phone": {
  678. "name": "phone",
  679. "type": "varchar(20)",
  680. "primaryKey": false,
  681. "notNull": false
  682. },
  683. "role": {
  684. "name": "role",
  685. "type": "varchar(20)",
  686. "primaryKey": false,
  687. "notNull": true
  688. },
  689. "admission_number": {
  690. "name": "admission_number",
  691. "type": "varchar(50)",
  692. "primaryKey": false,
  693. "notNull": false
  694. },
  695. "is_active": {
  696. "name": "is_active",
  697. "type": "boolean",
  698. "primaryKey": false,
  699. "notNull": false,
  700. "default": true
  701. },
  702. "created_at": {
  703. "name": "created_at",
  704. "type": "timestamp",
  705. "primaryKey": false,
  706. "notNull": false,
  707. "default": "now()"
  708. },
  709. "updated_at": {
  710. "name": "updated_at",
  711. "type": "timestamp",
  712. "primaryKey": false,
  713. "notNull": false,
  714. "default": "now()"
  715. }
  716. },
  717. "indexes": {},
  718. "foreignKeys": {},
  719. "compositePrimaryKeys": {},
  720. "uniqueConstraints": {
  721. "users_email_unique": {
  722. "name": "users_email_unique",
  723. "nullsNotDistinct": false,
  724. "columns": [
  725. "email"
  726. ]
  727. },
  728. "users_cedula_unique": {
  729. "name": "users_cedula_unique",
  730. "nullsNotDistinct": false,
  731. "columns": [
  732. "cedula"
  733. ]
  734. }
  735. },
  736. "policies": {},
  737. "checkConstraints": {},
  738. "isRLSEnabled": false
  739. }
  740. },
  741. "enums": {},
  742. "schemas": {},
  743. "sequences": {},
  744. "roles": {},
  745. "policies": {},
  746. "views": {},
  747. "_meta": {
  748. "columns": {},
  749. "schemas": {},
  750. "tables": {}
  751. }
  752. }