aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-11-09 02:21:42 +0100
committerTeddy Wing2018-11-09 02:26:12 +0100
commit99092d0cddd5f6cf8a5294a666999d885e430ba3 (patch)
treecb18ebfa2bb26b91810816a998901f36331327b3
parentf177451de4bdfe89a4141bcd9cbf2f0bb0aa059b (diff)
downloaddome-key-web-99092d0cddd5f6cf8a5294a666999d885e430ba3.tar.bz2
Add database config
Use 'migrant' for migrations (https://crates.io/crates/migrant). TOML config file generated and modified from `migrant init`. Database connection parameters should be passed in though environment variables, hence the '.env.sample'.
-rw-r--r--license-generator/.env.sample3
-rw-r--r--license-generator/.gitignore1
-rw-r--r--license-generator/Migrant.toml10
3 files changed, 14 insertions, 0 deletions
diff --git a/license-generator/.env.sample b/license-generator/.env.sample
new file mode 100644
index 0000000..7ed6243
--- /dev/null
+++ b/license-generator/.env.sample
@@ -0,0 +1,3 @@
+export DATABASE_NAME=""
+export DATABASE_USER=""
+export DATABASE_PASSWORD=""
diff --git a/license-generator/.gitignore b/license-generator/.gitignore
index 53eaa21..7799b0d 100644
--- a/license-generator/.gitignore
+++ b/license-generator/.gitignore
@@ -1,2 +1,3 @@
/target
**/*.rs.bk
+/.env
diff --git a/license-generator/Migrant.toml b/license-generator/Migrant.toml
new file mode 100644
index 0000000..e6ce3b7
--- /dev/null
+++ b/license-generator/Migrant.toml
@@ -0,0 +1,10 @@
+database_type = "mysql"
+
+database_name = "env:DATABASE_NAME"
+database_user = "env:DATABASE_USER"
+database_password = "env:DATABASE_PASSWORD"
+
+database_host = "env:DATABASE_HOST" # default "localhost"
+database_port = "env:DATABASE_PORT" # default "3306"
+
+[database_params]