diff --git a/README.md b/README.md index 0c964dd..875dd9c 100644 --- a/README.md +++ b/README.md @@ -53,9 +53,9 @@ Inside a directory create `trek.yaml`: ```yaml model_name: db_name: -db_users: - - - - +roles: + - name: db_user_1 + - name: db_user_2 ``` Create `.dbm` using pgModeler. diff --git a/example/foo.png b/example/foo.png index 9118f47..54c13c7 100644 Binary files a/example/foo.png and b/example/foo.png differ diff --git a/example/foo.sql b/example/foo.sql index 0ac60db..f46bd93 100644 --- a/example/foo.sql +++ b/example/foo.sql @@ -1,26 +1,10 @@ --- Database generated with pgModeler (PostgreSQL Database Modeler). --- pgModeler version: 0.9.4 --- PostgreSQL version: 13.0 --- Project Site: pgmodeler.io --- Model Author: --- --- -- object: alice | type: ROLE -- --- -- DROP ROLE IF EXISTS alice; --- CREATE ROLE alice WITH ; --- -- ddl-end -- --- --- -- object: bob | type: ROLE -- --- -- DROP ROLE IF EXISTS bob; --- CREATE ROLE bob WITH ; --- -- ddl-end -- --- +-- ** Database generated with pgModeler (PostgreSQL Database Modeler). +-- ** pgModeler version: 1.2.2 +-- ** PostgreSQL version: 18.0 +-- ** Project Site: pgmodeler.io +-- ** Model Author: --- --- Database creation must be performed outside a multi lined SQL file. --- These commands were put in this file only as a convenience. --- --- -- object: bar | type: DATABASE -- --- -- DROP DATABASE IF EXISTS bar; --- CREATE DATABASE bar; --- -- ddl-end -- --- +SET search_path TO pg_catalog,public; +-- ddl-end -- diff --git a/example/migrations/001_init.up.sql b/example/migrations/001_init.up.sql index 0ac60db..f46bd93 100644 --- a/example/migrations/001_init.up.sql +++ b/example/migrations/001_init.up.sql @@ -1,26 +1,10 @@ --- Database generated with pgModeler (PostgreSQL Database Modeler). --- pgModeler version: 0.9.4 --- PostgreSQL version: 13.0 --- Project Site: pgmodeler.io --- Model Author: --- --- -- object: alice | type: ROLE -- --- -- DROP ROLE IF EXISTS alice; --- CREATE ROLE alice WITH ; --- -- ddl-end -- --- --- -- object: bob | type: ROLE -- --- -- DROP ROLE IF EXISTS bob; --- CREATE ROLE bob WITH ; --- -- ddl-end -- --- +-- ** Database generated with pgModeler (PostgreSQL Database Modeler). +-- ** pgModeler version: 1.2.2 +-- ** PostgreSQL version: 18.0 +-- ** Project Site: pgmodeler.io +-- ** Model Author: --- --- Database creation must be performed outside a multi lined SQL file. --- These commands were put in this file only as a convenience. --- --- -- object: bar | type: DATABASE -- --- -- DROP DATABASE IF EXISTS bar; --- CREATE DATABASE bar; --- -- ddl-end -- --- +SET search_path TO pg_catalog,public; +-- ddl-end -- diff --git a/generate-example.sh b/generate-example.sh index ae4c231..c7a75d6 100755 --- a/generate-example.sh +++ b/generate-example.sh @@ -8,7 +8,9 @@ cd example TREK_VERSION=latest \ TREK_MODEL_NAME=foo \ TREK_DATABASE_NAME=bar \ -TREK_DATABASE_USERS=alice,bob \ +TREK_ROLES=alice,bob \ go run .. init go run .. check + +go run .. generate --stdout