【问题标题】:disable CreatedAt UpdatedAt DeletedAt GORM禁用 CreatedAt UpdatedAt DeletedAt GORM
【发布时间】:2022-12-02 04:45:21
【问题描述】:

I am usign GORM and I am mapping legacy tables.

By default GORM has this struct:

type Model struct {
        ID        uint `gorm:\"primarykey\"`
        CreatedAt time.Time
        UpdatedAt time.Time
        DeletedAt DeletedAt `gorm:\"index\"`
}

I don\'t have CreatedAt UpdatedAt DeletedAt fields in the legacy table, I need to avoid or disable this default structure.

I don\'t find a way to avoid this columns.

Thank you.

    标签: go go-gorm


    【解决方案1】:
    【解决方案2】:
    【解决方案3】:
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-07-19
    • 1970-01-01
    • 2018-10-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多