实现修改猪营养需求
This commit is contained in:
@@ -376,6 +376,20 @@ func (ps *PostgresStorage) creatingUniqueIndex(ctx context.Context) error {
|
||||
whereClause: "WHERE deleted_at IS NULL",
|
||||
description: "nutrients 表的部分唯一索引 (name 唯一)",
|
||||
},
|
||||
{
|
||||
tableName: models.Recipe{}.TableName(),
|
||||
columns: []string{"name"},
|
||||
indexName: "idx_recipes_unique_name_when_not_deleted",
|
||||
whereClause: "WHERE deleted_at IS NULL",
|
||||
description: "recipes 表的部分唯一索引 (name 唯一)",
|
||||
},
|
||||
{
|
||||
tableName: models.RecipeIngredient{}.TableName(),
|
||||
columns: []string{"recipe_id", "raw_material_id"},
|
||||
indexName: "idx_recipe_ingredients_unique_recipe_raw_material_when_not_deleted",
|
||||
whereClause: "WHERE deleted_at IS NULL",
|
||||
description: "recipe_ingredients 表的部分唯一索引 (recipe_id, raw_material_id 组合唯一)",
|
||||
},
|
||||
}
|
||||
|
||||
for _, indexDef := range uniqueIndexesToCreate {
|
||||
|
||||
Reference in New Issue
Block a user