diff --git a/backend/cmd/migrate/main.go b/backend/cmd/migrate/main.go index c2ecfe6..60639d1 100644 --- a/backend/cmd/migrate/main.go +++ b/backend/cmd/migrate/main.go @@ -187,7 +187,7 @@ func migratePrices(sqliteDB *sql.DB, mysqlDB *sql.DB) error { model string modelType string billingType string - channelType string + channelType uint currency string inputPrice float64 outputPrice float64 @@ -199,7 +199,7 @@ func migratePrices(sqliteDB *sql.DB, mysqlDB *sql.DB) error { tempModel sql.NullString tempModelType sql.NullString tempBillingType sql.NullString - tempChannelType sql.NullString + tempChannelType sql.NullInt64 tempCurrency sql.NullString tempInputPrice sql.NullFloat64 tempOutputPrice sql.NullFloat64 @@ -226,7 +226,7 @@ func migratePrices(sqliteDB *sql.DB, mysqlDB *sql.DB) error { `, id, model, modelType, billingType, channelType, currency, inputPrice, outputPrice, priceSource, status, createdAt, updatedAt, - createdBy, tempModel.String, tempModelType.String, tempBillingType.String, tempChannelType.String, + createdBy, tempModel.String, tempModelType.String, tempBillingType.String, tempChannelType.Int64, tempCurrency.String, tempInputPrice.Float64, tempOutputPrice.Float64, tempPriceSource.String, updatedBy.String, ) if err != nil { diff --git a/backend/models/price.go b/backend/models/price.go index 2c79a59..b10cc1b 100644 --- a/backend/models/price.go +++ b/backend/models/price.go @@ -38,7 +38,7 @@ func CreatePriceTableSQL() string { model VARCHAR(255) NOT NULL, model_type VARCHAR(50) NOT NULL, billing_type VARCHAR(50) NOT NULL, - channel_type VARCHAR(50) NOT NULL, + channel_type BIGINT UNSIGNED NOT NULL, currency VARCHAR(10) NOT NULL, input_price DECIMAL(10,6) NOT NULL, output_price DECIMAL(10,6) NOT NULL, @@ -50,7 +50,7 @@ func CreatePriceTableSQL() string { temp_model VARCHAR(255), temp_model_type VARCHAR(50), temp_billing_type VARCHAR(50), - temp_channel_type VARCHAR(50), + temp_channel_type BIGINT UNSIGNED, temp_currency VARCHAR(10), temp_input_price DECIMAL(10,6), temp_output_price DECIMAL(10,6),