got tables laid out correctl
This commit is contained in:
parent
4d533d295c
commit
a5f0979116
@ -42,7 +42,7 @@ func main() {
|
|||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
config := &Config{
|
config := &Config{
|
||||||
DBHost: "localhost",
|
DBHost: "localhost",
|
||||||
DBName: "postgres",
|
DBName: "dmcquay",
|
||||||
}
|
}
|
||||||
err := envconfig.Process("chipd", config)
|
err := envconfig.Process("chipd", config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
10
sql.go
10
sql.go
@ -3,7 +3,7 @@ package chipmunk
|
|||||||
const createdb = `
|
const createdb = `
|
||||||
CREATE TABLE IF NOT EXISTS
|
CREATE TABLE IF NOT EXISTS
|
||||||
users (
|
users (
|
||||||
id uuid PRIMARY KEY,
|
id SERIAL PRIMARY KEY,
|
||||||
email varchar(64) UNIQUE,
|
email varchar(64) UNIQUE,
|
||||||
admin boolean DEFAULT false
|
admin boolean DEFAULT false
|
||||||
);
|
);
|
||||||
@ -18,9 +18,11 @@ CREATE TABLE IF NOT EXISTS
|
|||||||
tranx (
|
tranx (
|
||||||
id SERIAL PRIMARY KEY,
|
id SERIAL PRIMARY KEY,
|
||||||
cost numeric DEFAULT 0,
|
cost numeric DEFAULT 0,
|
||||||
store varchar(64) UNIQUE,
|
store varchar(64),
|
||||||
info varchar(1024) UNIQUE,
|
info varchar(1024),
|
||||||
user uuid
|
category_id integer references categories(id) DEFAULT 0,
|
||||||
|
date timestamp DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
user_id integer references users(id) DEFAULT 0
|
||||||
);
|
);
|
||||||
`
|
`
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user