Some checks are pending
Security Checks / security (push) Waiting to run
补充安全码加密存储及受权限约束的再次查看,增加前端验证和自动隐藏;构建已通过,云端业务验收待完成。
20 lines
509 B
Go
20 lines
509 B
Go
package migration
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
)
|
|
|
|
func applyRecoveryCodeCiphertextSchema(ctx context.Context, exec executor, dialect Dialect) error {
|
|
definitions := map[Dialect]string{
|
|
DialectSQLite: "TEXT NULL",
|
|
DialectMySQL: "VARCHAR(512) NULL",
|
|
DialectPostgres: "VARCHAR(512) NULL",
|
|
}
|
|
definition, ok := definitions[dialect]
|
|
if !ok {
|
|
return fmt.Errorf("unsupported migration dialect %q", dialect)
|
|
}
|
|
return ensureColumn(ctx, exec, dialect, "recovery_code", "code_ciphertext", definition)
|
|
}
|