From 35999266235a810aee775a6ce204a6f62dd497fd Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 20 Jul 2020 17:49:43 +0200 Subject: [PATCH] Adds example of including columns in model generation --- templates/en/docs/db/models.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/templates/en/docs/db/models.md b/templates/en/docs/db/models.md index 2f3c259db..424fa3d63 100644 --- a/templates/en/docs/db/models.md +++ b/templates/en/docs/db/models.md @@ -40,6 +40,18 @@ Writing the files by hand is not the most efficient way to work. Soda (and Buffa <%= partial("en/docs/db/model.md") %> +You can specify each column of the model to soda in order for it to generate the code for you, like this: + +```bash +$ soda generate model [name] [column1]:[type] [column2]:[type] +``` + +This is how you would generate a person-model with columns for the persons name, age and bio: + +```bash +$ soda generate model person name:string age:int bio:text +``` + You can remove generated model by running: ```bash