entc/gen: singularize feature flag name for versioned migrations (#2350)

This commit is contained in:
MasseElch
2022-02-21 20:06:32 +01:00
committed by GitHub
parent d53b271917
commit d80f7cc41a
4 changed files with 8 additions and 8 deletions

View File

@@ -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,
}
)

View File

@@ -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.
//

View File

@@ -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