Skip to content

Commit

Permalink
[Dev] Add ERD for tracking database state (#256)
Browse files Browse the repository at this point in the history
* Added ERD triggered on migration

* Added alias
  • Loading branch information
kieraneglin authored May 22, 2024
1 parent 81d5efd commit 0cd6ac7
Show file tree
Hide file tree
Showing 5 changed files with 958 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN echo "Building for ${TARGETPLATFORM:?}"
RUN apt-get update -qq
RUN apt-get install -y inotify-tools curl git openssh-client jq \
python3 python3-setuptools python3-wheel python3-dev pipx \
python3-mutagen locales procps build-essential
python3-mutagen locales procps build-essential graphviz

# Install ffmpeg
RUN export FFMPEG_DOWNLOAD=$(case ${TARGETPLATFORM:-linux/amd64} in \
Expand Down
10 changes: 9 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,15 @@ defmodule Pinchflat.MixProject do
test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"],
"assets.setup": ["tailwind.install --if-missing", "esbuild.install --if-missing"],
"assets.build": ["tailwind default", "esbuild default"],
"assets.deploy": ["tailwind default --minify", "esbuild default --minify", "phx.digest"]
"assets.deploy": ["tailwind default --minify", "esbuild default --minify", "phx.digest"],
"ecto.migrate": [
"ecto.migrate",
~s(cmd [ -z "$MIX_ENV" ] && yarn run create-erd || echo "No ERD generated")
],
"ecto.rollback": [
"ecto.rollback",
~s(cmd [ -z "$MIX_ENV" ] && yarn run create-erd || echo "No ERD generated")
]
]
end
end
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"description": "Prettier is used for linting of all files so this package has to live in the root of the project. Use the other package.json files for dependencies. Also, look into making this global or something to remove the need for this file.",
"devDependencies": {
"prettier": "3.2.4"
"prettier": "3.2.4",
"sqleton": "https://github.com/kieraneglin/sqleton#ke/add-index-support"
},
"license": "<See the LICENSE file>"
"scripts": {
"create-erd": "sqleton -o priv/repo/erd.png priv/repo/pinchflat_dev.db"
},
"private": true
}
Binary file added priv/repo/erd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0cd6ac7

Please sign in to comment.