updating rest-api

This commit is contained in:
2026-07-17 11:56:13 -05:00
parent 39433a0044
commit c4d7f52d37
15 changed files with 276 additions and 9 deletions

View File

@@ -54,4 +54,20 @@ func createTables() {
if err != nil {
panic("Could not create table")
}
createRegistrationsTable := `
CREATE TABLE IF NOT EXISTS registrations (
id INTEGER PRIMARY KEY AUTOINCREMENT,
event_id INTEGER,
user_id INTEGER,
FOREIGN KEY(event_id) REFERENCES events(id),
FOREIGN KEY(user_id) REFERENCES users(id)
)
`
_, err = DB.Exec(createRegistrationsTable)
if err != nil {
panic("Could not create table")
}
}