Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dialect/sql/schema: add method to create a named versioned migration … #2385

Merged
merged 5 commits into from Mar 10, 2022

Conversation

masseelch
Copy link
Collaborator

…file

As suggested in #2382 this adds a new method NamedDiff() to create migration files with a name.

Comment on lines 142 to 145
// You can use the following method to give the migration files a name.
// if err := m.NamedDiff(context.Background(), "migration_name", tbls...); err != nil {
// log.Fatalln(err)
// }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix weird indentation

Copy link
Member

@a8m a8m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@masseelch masseelch merged commit 2853afc into master Mar 10, 2022
@masseelch masseelch deleted the migrate/named branch March 10, 2022 15:40
zeevmoney added a commit to zeevmoney/ent that referenced this pull request Mar 15, 2022
* master:
  doc/website/blog: versioned migrations (ent#2387)
  build(deps): bump github.com/spf13/cobra from 1.3.0 to 1.4.0 (ent#2386)
  go: upgrade atlas for tidb support (ent#2394)
  dialect/sql/schema: add method to create a named versioned migration … (ent#2385)
  docs: add maorlipchuk as a contributor for code (ent#2381)
  entc/gen: set Ref and Inverse for edge contains both From and To
  schema/field: expose RType.Implements method (ent#2379)
  docs: add imhuytq as a contributor for code (ent#2378)
  dialect/sql/schema: add name to versioned migration files (ent#2375)
  all: update atlasgo.io to latest (ent#2376)
  dialect/sql/schema: fix bug in atlas integration when working WithDropIndex/WithDropColumn (ent#2374)
  build(deps): bump actions/checkout from 2.4.0 to 3 (ent#2372)
  build(deps): bump actions/setup-node from 2.5.1 to 3 (ent#2365)
gitlawr pushed a commit to gitlawr/ent that referenced this pull request Apr 13, 2022
ent#2385)

* dialect/sql/schema: add method to create a named versioned migration file

* doc/md: documentation for named versioned migrations

* entc/gen/template/dialect/sql/feature: add NamedDiff method to create named versioned migration files

* all: go generate

* doc/md: apply CR
gitlawr pushed a commit to seal-io/ent that referenced this pull request Apr 13, 2022
ent#2385)

* dialect/sql/schema: add method to create a named versioned migration file

* doc/md: documentation for named versioned migrations

* entc/gen/template/dialect/sql/feature: add NamedDiff method to create named versioned migration files

* all: go generate

* doc/md: apply CR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants