Migrate to version 2
This commit is contained in:
parent
4ac3625f45
commit
96f8dfa35e
21 changed files with 777 additions and 746 deletions
19
models/models.go
Normal file
19
models/models.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
var Schema = `
|
||||
CREATE TABLE transactions (
|
||||
id PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
|
||||
membre_id VARCHAR(7),
|
||||
given_at TIMESTAMP,
|
||||
is_perpetual BOOLEAN
|
||||
);
|
||||
`
|
||||
|
||||
type Transaction struct {
|
||||
ID string `db:"id" json:"id"`
|
||||
MembreID string `db:"membre_id" json:"membre_id"`
|
||||
GivenAt *time.Time `db:"given_at" json:"given_at"`
|
||||
IsPerpetual bool `db:"is_perpetual" json:"is_perpetual"`
|
||||
}
|
Reference in a new issue