diff --git a/bin/templates/pkg/db/crud/crud_table_update_func.go_ b/bin/templates/pkg/db/crud/crud_table_update_func.go_ index 4632daa..096bd13 100644 --- a/bin/templates/pkg/db/crud/crud_table_update_func.go_ +++ b/bin/templates/pkg/db/crud/crud_table_update_func.go_ @@ -30,7 +30,7 @@ func (crud Crud_DB) Read_ctx(ctx context.Context, m *lawsuit_status_types.Lawsui db.WithContext(ctx) // - tx := db.Model(&m).Update("Name", m.ID) + tx := db.Model(&m).Update("ColumnName", m.ColumnName) err = tx.Error if err != nil { err = fmt.Errorf("Read() id: %v, error: %v", m.ID, err) diff --git a/internal/create_files/db_crud_tables/db_crud_tables.go b/internal/create_files/db_crud_tables/db_crud_tables.go index 14db937..77736f4 100644 --- a/internal/create_files/db_crud_tables/db_crud_tables.go +++ b/internal/create_files/db_crud_tables/db_crud_tables.go @@ -583,8 +583,7 @@ func FindTextUpdateEveryColumn1(TextCrudUpdateFunc string, Table1 *types.Table, Otvet = strings.ReplaceAll(Otvet, "ColumnName", ColumnName) Otvet = strings.ReplaceAll(Otvet, "Model.ID", "Model."+ColumnName) Otvet = strings.ReplaceAll(Otvet, "Request.ID", "Request."+TextRequestFieldName) - Otvet = strings.ReplaceAll(Otvet, " Name ", " "+ColumnName+" ") - Otvet = strings.ReplaceAll(Otvet, `"Name"`, `"`+ColumnName+`"`) + //Otvet = strings.ReplaceAll(Otvet, "ColumnName", ColumnName) //Otvet = strings.ReplaceAll(Otvet, "m.ID", "m."+ColumnName) return Otvet @@ -619,7 +618,6 @@ func CreateTestFilesUpdateEveryColumn(Table1 *types.Table) error { TextCrud := "package " + config.Settings.PREFIX_CRUD + TableName + "\n\n" TextCrud = TextCrud + `import ( "testing" - "errors" "github.com/ManyakRus/starter/config_main" "github.com/ManyakRus/starter/postgres_gorm" )