34 lines
614 B
Go
34 lines
614 B
Go
|
package models
|
||
|
|
||
|
const Schema = `
|
||
|
CREATE TABLE programmes (
|
||
|
id TEXT PRIMARY KEY,
|
||
|
titre TEXT
|
||
|
);
|
||
|
|
||
|
CREATE TABLE membres (
|
||
|
id VARCHAR(7) PRIMARY KEY,
|
||
|
last_name TEXT,
|
||
|
first_name TEXT,
|
||
|
prefered_name TEXT,
|
||
|
programme_id TEXT REFERENCES programmes(id)
|
||
|
);
|
||
|
`
|
||
|
|
||
|
type Programme struct {
|
||
|
ID string `db:"id"`
|
||
|
Titre string `db:"titre"`
|
||
|
}
|
||
|
|
||
|
type Membre struct {
|
||
|
ID string `db:"id"`
|
||
|
LastName string `db:"last_name"`
|
||
|
FirstName string `db:"first_name"`
|
||
|
PreferedName string `db:"prefered_name"`
|
||
|
ProgrammeID string `db:"programme_id"`
|
||
|
}
|
||
|
|
||
|
type Entry interface {
|
||
|
Programme | Membre
|
||
|
}
|