Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

去除 version 字段的 Add 条件 #1230

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

去除 version 字段的 Add 条件 #1230

wants to merge 1 commit into from

Commits on Feb 14, 2019

  1. 去除 version 字段的 Add 条件

    当 结构体开启 version tag 时, 使用 update 方法, 第一个参数(更新的字段)结构体指针中 Version 字段默认为 0, 导致找不到更新的数据.
    调用的方式为:
    ```
    update := &FeedItem{
    	DatePublished: "2019-01-9",
    }
    engine.Where("date_published = ?", "2019-01-11").Update(update)
    ```
    生成的 sql 类似于:
    ```
    [xorm] [info]  2019/02/14 17:36:46.057228 [SQL] UPDATE "feed_item" SET "date_published" = $1, "updated" = $2, "version" = "version" + 1 WHERE (date_published = $3) AND "version"=$4 []interface {}{"2019-01-9", 1550137006, "2019-01-11", 0}
    ```
    yuancjun authored Feb 14, 2019
    Configuration menu
    Copy the full SHA
    47f1e2b View commit details
    Browse the repository at this point in the history