feat(auth): 注册协议 - 合并同意校验并顺延迁移版本
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const CurrentSchemaVersion int64 = 32
|
||||
const CurrentSchemaVersion int64 = 33
|
||||
|
||||
const baselineSchemaChecksum = "sha256:open-ai-canvas-schema-v1-20260830"
|
||||
const schemaMigrationAppliedAtIndexChecksum = "sha256:schema-migrations-applied-at-index-v2-20260830"
|
||||
@@ -106,6 +106,7 @@ var schemaMigrations = []migration{
|
||||
return tx.AutoMigrate(&model.ToolFavorite{})
|
||||
}},
|
||||
{version: 32, name: "channel_model_tags", checksum: "sha256:channel-model-tags-v32", apply: migrateChannelModelTags},
|
||||
{version: 33, name: "oauth_state_accepted_terms", checksum: "sha256:oauth-state-accepted-terms-v33", apply: migrateOAuthStateAcceptedTerms},
|
||||
}
|
||||
|
||||
func migrateChannelModelTags(tx *gorm.DB) error {
|
||||
@@ -115,6 +116,13 @@ func migrateChannelModelTags(tx *gorm.DB) error {
|
||||
return tx.Migrator().AddColumn(&model.ChannelModel{}, "Tags")
|
||||
}
|
||||
|
||||
func migrateOAuthStateAcceptedTerms(tx *gorm.DB) error {
|
||||
if tx.Migrator().HasColumn(&model.OAuthState{}, "AcceptedTerms") {
|
||||
return nil
|
||||
}
|
||||
return tx.Migrator().AddColumn(&model.OAuthState{}, "AcceptedTerms")
|
||||
}
|
||||
|
||||
func migrateChannelCreditCost(tx *gorm.DB) error {
|
||||
for _, entity := range []any{&model.ChannelModelPriceTier{}, &model.BillingOrder{}} {
|
||||
for _, column := range []string{"cost_configured", "cost_unit_price_microcredits", "cost_input_token_price_microcredits", "cost_output_token_price_microcredits", "cost_cached_token_price_microcredits"} {
|
||||
|
||||
Reference in New Issue
Block a user