feat(model): 模型支持高级配置

This commit is contained in:
yokowu
2025-07-30 16:10:01 +08:00
parent a3b3746b3f
commit 3435df2caa
24 changed files with 1377 additions and 61 deletions

View File

@@ -167,11 +167,11 @@ func init() {
// model.DefaultStatus holds the default value on creation for the status field.
model.DefaultStatus = consts.ModelStatus(modelDescStatus.Default.(string))
// modelDescCreatedAt is the schema descriptor for created_at field.
modelDescCreatedAt := modelFields[14].Descriptor()
modelDescCreatedAt := modelFields[15].Descriptor()
// model.DefaultCreatedAt holds the default value on creation for the created_at field.
model.DefaultCreatedAt = modelDescCreatedAt.Default.(func() time.Time)
// modelDescUpdatedAt is the schema descriptor for updated_at field.
modelDescUpdatedAt := modelFields[15].Descriptor()
modelDescUpdatedAt := modelFields[16].Descriptor()
// model.DefaultUpdatedAt holds the default value on creation for the updated_at field.
model.DefaultUpdatedAt = modelDescUpdatedAt.Default.(func() time.Time)
// model.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.