updating rest-api
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user