refactor: déplacer schema vers sql/schema.sql et sql.Schema()

This commit is contained in:
Victor Lacasse-Beaudoin 2024-09-16 14:42:32 -04:00
parent e945907771
commit 40dcd82e54
5 changed files with 20 additions and 10 deletions

7
sql/schema.sql Normal file
View file

@ -0,0 +1,7 @@
-- Schema
CREATE TABLE IF NOT EXISTS transactions (
id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
membre_id VARCHAR(7) NOT NULL,
given_at TIMESTAMP DEFAULT current_timestamp,
is_perpetual BOOLEAN NOT NULL
);

10
sql/sql.go Normal file
View file

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