1/26/2024 0 Comments Schema diagram elixir ecto![]() ![]() the code base with ecto_erd to get a nice DOT.the (Postgres) database with Planter to get a nice PUML,."Diagram-as-code" with DBML is interesting especially with the handy dbdiagram.io but not a CD tool, rather limited to being a first design tool in dev mode you can't manage subsequent migrations and the code will not be kept synced automatically with the project. If you go back to the database folder, click right and select "Generate ERD" as belowĪnd you have an ER snapshot of the database:ĮRD is a valuable tool to communicate and visualizing the database. Then execute the loaded script with F5 (or the triangle),Īnd finally, check the tables (maybe Refresh with a right click). To use it, navigate to your database folder in the integrated browser, then the public folder, select "Tools" (top menu), then "Query Tool", then select the SQL script (first icon as shown below). Conversely, you can draw an ER diagram with it and generate the migration script. Once you run the script, you can generate an ERS snapshot. This is a "manual" operation and thus can't be used when you release your Docker image. lastly, you can also use the pgAdmin interface.You then use the DBML cli to convert the SQL script into DBML code: You can do this programmatically with for example a small cleaning task. We need to clean the logs to extract only the SQL commands. We set up the PostgreSQL database, code the migrations with Ecto, run them and save the logs to get the SQL script. a Character can have many Actors per Movie through contracts,.an Actor has a unique Character per Movie through a unique Contract for a certain amount,.a Movie has one Producer, and a Producer can have many movies,.The database should capture the following relations: We take four models/schemas talking about movies, actors, producers and characters. The diagram below shows where all these tools can be used. You can generate the default DOT format or PUML code or DBML code. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |