feat(auth): 注册协议 - 增加同意校验并预留影策协议正文

This commit is contained in:
陈泽
2026-09-20 22:57:31 +08:00
parent 0e3fb79ba6
commit 316386a2bd
16 changed files with 372 additions and 30 deletions

View File

@@ -11,7 +11,7 @@ import (
"gorm.io/gorm"
)
const CurrentSchemaVersion int64 = 31
const CurrentSchemaVersion int64 = 32
const baselineSchemaChecksum = "sha256:open-ai-canvas-schema-v1-20260830"
const schemaMigrationAppliedAtIndexChecksum = "sha256:schema-migrations-applied-at-index-v2-20260830"
@@ -105,6 +105,14 @@ var schemaMigrations = []migration{
{version: 31, name: "tool_favorites", checksum: "sha256:tool-favorites-v31", apply: func(tx *gorm.DB) error {
return tx.AutoMigrate(&model.ToolFavorite{})
}},
{version: 32, name: "oauth_state_accepted_terms", checksum: "sha256:oauth-state-accepted-terms-v32", apply: migrateOAuthStateAcceptedTerms},
}
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 {