This commit is contained in:
Victor Lacasse-Beaudoin 2024-12-30 19:13:05 -05:00
parent abda13d070
commit 7f3901ddc2
8 changed files with 46 additions and 57 deletions

10
queries/queries.go Normal file
View file

@ -0,0 +1,10 @@
package queries
import _ "embed"
//go:embed schema.sql
var sqlSchema string
func SQLSchema() string {
return sqlSchema
}

7
queries/schema.sql Normal file
View file

@ -0,0 +1,7 @@
-- Schema
CREATE TABLE IF NOT EXISTS transactions (
given_at TIMESTAMP DEFAULT current_timestamp,
membre_id VARCHAR(7) NOT NULL CHECK (length(membre_id) > 0),
is_perpetual BOOLEAN NOT NULL,
PRIMARY KEY (membre_id, is_perpetual)
);