From 3b2e79f0aade93d8e1b2009d468129c45e04ddcd Mon Sep 17 00:00:00 2001 From: Eric Ihli Date: Tue, 8 Jun 2021 22:16:59 -0500 Subject: [PATCH] Add README and update migration code --- Makefile | 2 +- README.org | 7 +++++++ db/README.org | 4 ++-- web/deps.edn | 2 +- web/dev/migrations.clj | 9 ++++++++- 5 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 README.org diff --git a/Makefile b/Makefile index 1471848..fc1e38e 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ src = $(shell find web -type f -iname *.clj 2>/dev/null) -LottoEmail.jar: $(src) +darklimericks.jar: $(src) cd web && clj -A:depstar -M:depstar -m hf.depstar.uberjar \ darklimericks.jar -C -m com.darklimericks.server.core diff --git a/README.org b/README.org new file mode 100644 index 0000000..aa86067 --- /dev/null +++ b/README.org @@ -0,0 +1,7 @@ +#+TITLE: DarkLimericks + +* Development + +Requires [[https://github.com/tachyons-css/tachyons/][Tachyons CSS]]. There is a symlink in ~web/resources/public~ to the pre-built ~tachyons.css~ and ~tachyons.min.css~ found in the repo. + +Build ~.jar~ with ~clojure -X:depstart uberjar :jar prhyme.jar~. diff --git a/db/README.org b/db/README.org index 4aa4075..33ef53c 100644 --- a/db/README.org +++ b/db/README.org @@ -4,8 +4,8 @@ This directory contains necessities for initializing and running a database locally inside a docker container. -We want our develpment environment to use the same tech stack that production -uses. So rather than suppord a development configuration that uses SQLite and a +We want our development environment to use the same tech stack that production +uses. So rather than support a development configuration that uses SQLite and a production configuration that uses PostgreSQL, just use PostgreSQL for both. With Docker, it's easy. diff --git a/web/deps.edn b/web/deps.edn index a276347..e7c7333 100644 --- a/web/deps.edn +++ b/web/deps.edn @@ -22,7 +22,7 @@ migratus {:mvn/version "1.3.2"} ring/ring-core {:mvn/version "1.8.2"} environ {:mvn/version "1.2.0"} - prhyme {:local/root "/home/eihli/code/prhyme/prhyme.jar"}} + prhyme {:local/root "/home/eihli/src/prhyme"}} :paths ["src" "resources"] :aliases {:dev {:extra-paths ["dev"] :extra-deps {hawk {:mvn/version "0.2.11"} diff --git a/web/dev/migrations.clj b/web/dev/migrations.clj index 5ad2d51..ece5089 100644 --- a/web/dev/migrations.clj +++ b/web/dev/migrations.clj @@ -5,10 +5,17 @@ (def config {:store :database :migration-dir "migrations/" :init-script "init.sql" - :db {:connection-uri (-> state/config :database.sql/connection :jdbcUrl)}}) + :db {:connection-uri (:jdbcUrl (-> state/config :com.darklimericks.db.core/connection))}}) (comment + + + config + + (migratus/init config) + (migratus/migrate config) + (migratus/create config "User Limericks") state/config (:database.sql/connection state/system)