Skip to content

Commit

Permalink
updates README.md with latest used commands
Browse files Browse the repository at this point in the history
  • Loading branch information
StealWonders committed Jun 14, 2024
1 parent ffe2e6e commit 230b817
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,16 @@ Create a new migration:
atlas migrate diff <migration_name> \
--dir "file://internal/database/migrations" \
--to "ent://internal/database/schema" \
--dev-url "postgres://mensatt:mensatt@localhost:5432/mensatt?search_path=public&sslmode=disable" \
--dev-url "docker://postgres/15/dev?search_path=public" \
--format '{{ sql . " " }}'
```
The `--format` flag uses a tab as indentation. If you want to manually edit this command you can use
`ctrl + v + tab` to insert a tab character in your shell.
The `--dev-url` flag is used to connect to an ephemeral local Docker container containing a PostgreSQL instance required for creating the migration.

Apply the migration:
```bash
atlas migrate apply \
--dir "file://internal/database/migrations" \
--url "postgres://mensatt:mensatt@localhost:5432/mensatt?search_path=public&sslmode=disable"
```

0 comments on commit 230b817

Please sign in to comment.