Skip to content

Instantly share code, notes, and snippets.

@vnegrisolo
Last active October 16, 2017 08:31
Show Gist options
  • Save vnegrisolo/f6af747b1030dae3d1a1a8fcd2eee6a9 to your computer and use it in GitHub Desktop.
Save vnegrisolo/f6af747b1030dae3d1a1a8fcd2eee6a9 to your computer and use it in GitHub Desktop.
ERD from text file
FROM haskell:7.8.4
RUN apt-get update && apt-get --assume-yes install graphviz vim curl git
RUN cabal update && cabal install graphviz parsec text && cabal install erd
COPY graph.in .
#!/bin/bash
docker build -f Dockerfile.erd -t erd .
docker run --rm erd bash -c 'erd -i graph.in' > graph.pdf
open graph.pdf
title {label: "ERD (Entity-Relationship diagram)", size: "20"}
################################################################################
# Entities
################################################################################
[post] {bgcolor: "#dc322f"}
title {label: "string"}
[user] {bgcolor: "#cb4b16"}
email {label: "string"}
password {label: "string"}
################################################################################
# Relationships
################################################################################
user 1--* post
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment