- Timestamp:
- 09/16/26 14:48:55 (7 days ago)
- Branches:
- master
- Children:
- 8ee90bd
- Parents:
- ea40556
- Location:
- sql
- Files:
-
- 4 edited
-
data_load.sql (modified) (1 diff)
-
iknow.dbml (modified) (2 diffs)
-
schema.md (modified) (3 diffs)
-
schema_creation.sql (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sql/data_load.sql
rea40556 rc42181c 115 115 (3, 1, 'tok_old789_stefan', '2026-01-01 00:00:00', FALSE); 116 116 117 INSERT INTO payment (id, user_id,enrollment_id, amount) VALUES118 (1, 1, 1,200),119 (2, 1,2, 200),120 (3, 2,3, 400),121 (4, 3,4, 200);117 INSERT INTO payment (id, enrollment_id, amount) VALUES 118 (1, 1, 200), 119 (2, 2, 200), 120 (3, 3, 400), 121 (4, 4, 200); 122 122 123 123 INSERT INTO major_subjects (major_id, subject_id, mandatory_semester) VALUES -
sql/iknow.dbml
rea40556 rc42181c 150 150 Table project.payment { 151 151 id integer [pk, increment] 152 user_id integer [not null]153 152 enrollment_id integer [not null] 154 153 amount integer [not null] … … 188 187 Ref: project.contact.user_id - project.users.id // has_contact (1:1) 189 188 Ref: project.token.user_id > project.users.id // has_token 190 Ref: project.payment.user_id > project.users.id // pays191 189 Ref: project.payment.enrollment_id > project.enrolled_semesters.id // for_enrollment 192 190 Ref: project.enrolled_semesters.user_id > project.users.id // submits -
sql/schema.md
rea40556 rc42181c 111 111 payment { 112 112 integer id PK 113 integer user_id FK114 113 integer enrollment_id FK 115 114 integer amount … … 136 135 users ||--o| contact : has_contact 137 136 users ||--o{ token : has_token 138 users ||--o{ payment : pays139 137 users ||--o{ enrolled_semesters : submits 140 138 users ||--o{ user_documents : owns … … 184 182 they differ. 185 183 - `professour_subjects` keeps the spelling used by the table in `schema_creation.sql`. 184 - `payment` has no `user_id`: the student is reached through `enrollment_id`. 185 Storing it twice violated BCNF (`enrolled_id -> user_id`) and allowed a 186 payment to contradict the enrolment it refers to. Removed in Phase 5. -
sql/schema_creation.sql
rea40556 rc42181c 115 115 CREATE TABLE payment ( 116 116 id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, 117 user_id INTEGER NOT NULL REFERENCES users (id),118 117 enrollment_id INTEGER NOT NULL REFERENCES enrolled_semesters (id), 119 118 amount INTEGER NOT NULL
Note:
See TracChangeset
for help on using the changeset viewer.
