forked from phc/website
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.2 KiB
Go
54 lines
1.2 KiB
Go
package database
|
|
|
|
//
|
|
// Tables
|
|
//
|
|
|
|
type Dispensa struct {
|
|
Id string `db:"id"`
|
|
CreatedAt string `db:"created_at"`
|
|
OwnerId string `db:"owner_id"`
|
|
Title string `db:"title"`
|
|
Description string `db:"description"`
|
|
}
|
|
|
|
type Upload struct {
|
|
Id string `db:"id"`
|
|
CreatedAt string `db:"created_at"`
|
|
OwnerId string `db:"owner_id"`
|
|
DispensaId string `db:"dispensa_id"`
|
|
File string `db:"file"`
|
|
}
|
|
|
|
type FileApproval struct {
|
|
Id string `db:"id"`
|
|
CreatedAt string `db:"created_at"`
|
|
OwnerId string `db:"owner_id"`
|
|
UploadId string `db:"upload_id"`
|
|
Status string `db:"status"` // "approved" | "rejected"
|
|
}
|
|
|
|
type Download struct {
|
|
DispensaId string `db:"dispensa_id"`
|
|
Timestamp string `db:"timestamp"`
|
|
}
|
|
|
|
type Tag struct {
|
|
DispensaId string `db:"dispensa_id"`
|
|
Tag string `db:"tag"`
|
|
}
|
|
|
|
//
|
|
// Common Joins
|
|
//
|
|
|
|
// DispensaFile is a join of dispensa with the most recent upload for that "dispensa_id"
|
|
type DispensaFile struct {
|
|
DispensaId string `db:"dispensa_id"`
|
|
UploadId string `db:"upload_id"`
|
|
OwnerId string `db:"owner_id"`
|
|
Title string `db:"title"`
|
|
Description string `db:"description"`
|
|
File string `db:"file"`
|
|
}
|