mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: singularize feature flag name for versioned migrations (#2350)
This commit is contained in:
@@ -92,8 +92,8 @@ var (
|
||||
Description: "Allows users to configure the `ON CONFLICT`/`ON DUPLICATE KEY` clause for `INSERT` statements",
|
||||
}
|
||||
|
||||
FeatureVersionedMigrations = Feature{
|
||||
Name: "sql/versioned-migrations",
|
||||
FeatureVersionedMigration = Feature{
|
||||
Name: "sql/versioned-migration",
|
||||
Stage: Experimental,
|
||||
Default: false,
|
||||
Description: "Allows users to work with versioned migrations / migration files",
|
||||
@@ -108,7 +108,7 @@ var (
|
||||
FeatureLock,
|
||||
FeatureModifier,
|
||||
FeatureUpsert,
|
||||
FeatureVersionedMigrations,
|
||||
FeatureVersionedMigration,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ func (s *Schema) Create(ctx context.Context, opts ...schema.MigrateOption) error
|
||||
return migrate.Create(ctx, Tables...)
|
||||
}
|
||||
|
||||
{{ if $.Config.FeatureEnabled "sql/versioned-migrations" }}{{ template "migrate/diff" $ }}{{ end }}
|
||||
{{ if $.Config.FeatureEnabled "sql/versioned-migration" }}{{ template "migrate/diff" $ }}{{ end }}
|
||||
|
||||
// WriteTo writes the schema changes to w instead of running them against the database.
|
||||
//
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
|
||||
package versioned
|
||||
|
||||
//go:generate go run -mod=mod entgo.io/ent/cmd/ent generate --feature sql/versioned-migrations --header "// Copyright 2019-present Facebook Inc. All rights reserved.\n// This source code is licensed under the Apache 2.0 license found\n// in the LICENSE file in the root directory of this source tree.\n\n// Code generated by entc, DO NOT EDIT." ./schema
|
||||
//go:generate go run -mod=mod entgo.io/ent/cmd/ent generate --feature sql/versioned-migration --header "// Copyright 2019-present Facebook Inc. All rights reserved.\n// This source code is licensed under the Apache 2.0 license found\n// in the LICENSE file in the root directory of this source tree.\n\n// Code generated by entc, DO NOT EDIT." ./schema
|
||||
|
||||
Reference in New Issue
Block a user