migration/

directory
v0.0.0-...-90870c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2024 License: Apache-2.0

README

Versioned Migration Example

The full reference example for https://entgo.io/docs/versioned-migrations#create-a-migration-files-generator.

Migration directory

Versioned migration files exists under ent/migrate/migrations.

Changes to the Ent schema

1. Change the ent/schema.

2. Run go generate ./ent

Generate a new migration file
atlas migrate diff <migration_name> \
  --dir "file://ent/migrate/migrations" \
  --to "ent://ent/schema" \
  --dev-url "docker://mysql/8/ent"
Run migration linting
atlas migrate lint \
  --dev-url="mysql://root:pass@localhost:3306/test" \
  --dir="file://ent/migrate/migrations" \
  --latest=1

Directories

Path Synopsis
ent
pet

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL