refactor: déplacer schema vers sql/schema.sql et sql.Schema()
This commit is contained in:
parent
e945907771
commit
40dcd82e54
5 changed files with 20 additions and 10 deletions
7
sql/schema.sql
Normal file
7
sql/schema.sql
Normal 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
10
sql/sql.go
Normal file
|
@ -0,0 +1,10 @@
|
|||
package sql
|
||||
|
||||
import _ "embed"
|
||||
|
||||
//go:embed schema.sql
|
||||
var schema string
|
||||
|
||||
func Schema() string {
|
||||
return schema
|
||||
}
|
Reference in a new issue