added sql to go with db

This commit is contained in:
Derek McQuay 2017-02-04 19:48:02 -08:00
parent 5985527302
commit 4d5077d72d
No known key found for this signature in database
GPG Key ID: 92A7BC0C86B0B91A

35
sql.go Normal file
View File

@ -0,0 +1,35 @@
package chipmunk
const createdb = `
CREATE TABLE IF NOT EXISTS
users (
id uuid PRIMARY KEY,
email varchar(64) UNIQUE,
admin boolean DEFAULT false
);
CREATE TABLE IF NOT EXISTS
categories (
id SERIAL PRIMARY KEY,
name varchar(1024) UNIQUE
);
CREATE TABLE IF NOT EXISTS
tranx (
id SERIAL PRIMARY KEY,
cost numeric DEFAULT 0,
store varchar(64) UNIQUE,
info varchar(1024) UNIQUE,
user uuid
);
`
const primeCategories = `
INSERT INTO categories (name) VALUES
('Derek'),
('Colleen'),
('Groceries'),
('Restaurant'),
('Misc')
;
`