From 906b09eaf750d706bc4197153d4790652789f098 Mon Sep 17 00:00:00 2001 From: tavo Date: Mon, 16 Sep 2024 17:39:08 -0600 Subject: [PATCH] updated DB requirements, moved DB execution to main, couple of css fixes --- Makefile | 9 ++++++++- README.org | 9 ++++++--- public/index.html | 4 ++-- public/static/css/style.css | 10 +++++----- public/static/svg/image.svg | 16 ++++++++++++++++ server/db.go | 2 +- server/main.go | 23 ++++++++++++++++------- 7 files changed, 54 insertions(+), 19 deletions(-) create mode 100644 public/static/svg/image.svg diff --git a/Makefile b/Makefile index c11f8f9..ff04c0a 100644 --- a/Makefile +++ b/Makefile @@ -10,11 +10,18 @@ GOMODS = github.com/joho/godotenv \ github.com/lib/pq \ gopkg.in/gomail.v2 \ -all: ${BIN} +all: ${BIN} fmt ${BIN}: ${SRC} ${GOFILES} (cd ${SRCDIR} && go build -o ../${BIN}) +fmt: ${SRC} + @diff=$$(gofmt -d $^); \ + if [ -n "$$diff" ]; then \ + printf '%s\n' "$$diff"; \ + exit 1; \ + fi + ${GOFILES}: (cd ${SRCDIR} && go mod init ${BIN}) (cd ${SRCDIR} && go get ${GOMODS}) diff --git a/README.org b/README.org index fb18b38..de91e99 100644 --- a/README.org +++ b/README.org @@ -22,7 +22,7 @@ CREATE DATABASE iterone OWNER conex; DROP TABLE IF EXISTS changes; DROP TABLE IF EXISTS payments; DROP TABLE IF EXISTS sites; - + CREATE TABLE sites ( id SERIAL PRIMARY KEY, folder VARCHAR(35) UNIQUE NOT NULL, @@ -33,6 +33,9 @@ CREATE TABLE sites ( email VARCHAR(100) NOT NULL, phone VARCHAR(20), code VARCHAR(2), + title VARCHAR(35) NOT NULL, + slogan VARCHAR(100) NOT NULL, + banner TEXT, raw JSONB NOT NULL, auth INTEGER, valid TIMESTAMPTZ @@ -44,8 +47,8 @@ SELECT * FROM sites; #+END_SRC #+RESULTS: -| id | folder | status | due | name | sur | email | phone | code | raw | auth | valid | -|----+--------+--------+-----+------+-----+-------+-------+------+-----+------+-------| +| id | folder | status | due | name | sur | email | phone | code | title | slogan | banner | raw | auth | valid | +|----+--------+--------+-----+------+-----+-------+-------+------+-------+--------+--------+-----+------+-------| ** Payments table diff --git a/public/index.html b/public/index.html index 21a3d36..41dcd28 100644 --- a/public/index.html +++ b/public/index.html @@ -14,12 +14,12 @@