aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-08-01 01:04:28 +0200
committerTeddy Wing2017-08-01 01:11:32 +0200
commit125ca30fd9a5f91e5b39f6c9d232bfb1b4e4052c (patch)
treee57e6306d9bc0bf055b4a91e94b204c458da5a41
parentd1bdc16c9b1ad9a2b17b90a998640ebad1c02f9a (diff)
downloadsorbot-125ca30fd9a5f91e5b39f6c9d232bfb1b4e4052c.tar.bz2
Install 'dbmigrations-sqlite'
Use this for database migrations. Seems to be the right tool for database migrations in Haskell. Originally I had thought about doing it manually with 'up' and 'down' SQL files and some kind of Makefile or script to run them, but then realised that, of course, you have to keep track of which migration you're on, and figured, well, might want to outsource that to another program. I had originally written my migration in Mark Bates' pop/soda format, but will have to convert that for 'dbmigrations'. Thankfully got a little help from https://github.com/basti1302/elm-lang-de#development-setup on how to actually install the 'dbmigrations-sqlite' package using Stack. Put the installation command into a new "setup.sh" file to make it easily repeatable. Needed to add a bunch of lines to the `extra-deps` section of "stack.yaml" in order to be able to properly install the package.
-rwxr-xr-xsetup.sh5
-rw-r--r--stack.yaml7
2 files changed, 11 insertions, 1 deletions
diff --git a/setup.sh b/setup.sh
new file mode 100755
index 0000000..0160a41
--- /dev/null
+++ b/setup.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+set -e
+
+stack install dbmigrations-sqlite
diff --git a/stack.yaml b/stack.yaml
index 6cbacba..27a17ad 100644
--- a/stack.yaml
+++ b/stack.yaml
@@ -39,7 +39,12 @@ packages:
- '.'
# Dependency packages to be pulled from upstream that are not in the resolver
# (e.g., acme-missiles-0.3)
-extra-deps: []
+extra-deps:
+- dbmigrations-2.0.0
+- dbmigrations-sqlite-2.0.0
+- HDBC-sqlite3-2.3.3.1
+- HsSyck-0.53
+- yaml-light-0.1.4
# Override default flag values for local packages and extra-deps
flags: {}