Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
```
27 changes: 25 additions & 2 deletions internal/database/ent/image.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions internal/database/ent/image/image.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 90 additions & 0 deletions internal/database/ent/image/where.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading