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.

sync问题 #61

Closed
yaotian opened this issue Mar 1, 2014 · 7 comments
Closed

sync问题 #61

yaotian opened this issue Mar 1, 2014 · 7 comments
Assignees
Labels

Comments

@yaotian
Copy link

yaotian commented Mar 1, 2014

对model增加一个列,然后sync后,这个列会在数据库中被创建。
问题是:
如果我手动对表增加了一列(这个列增加的是正确的),我做sync,会报错说"duplicate column name:"

如何解决?

@lunny
Copy link
Member

lunny commented Mar 1, 2014

1.请问使用的数据库类型?
2.结构体和新增的列信息可否提供?

@yaotian
Copy link
Author

yaotian commented Mar 1, 2014

数据库:sqlite

结构体
type Picture struct {
Id int64
Url string xorm:"unique" //image's url
Title string
Description string
Created time.Time xorm:"created"
ILike int
PageView int
From_url string
Pre_url string xorm:"unique" //pre view image's url
Uid int64
}

报错的列表
Pre_url string xorm:"unique"

我感觉不是个别列出错。好像是如果手工去增加列,再去sync会出错。

2014-03-01 20:34 GMT+08:00 Lunny Xiao notifications@github.com:

1.请问使用的数据库类型?
2.结构体和新增的列信息可否提供?


Reply to this email directly or view it on GitHubhttps://github.com/lunny/xorm/issues/61#issuecomment-36423613
.

@admpub
Copy link
Member

admpub commented Mar 1, 2014

难道是缓存?有没有重启过应用?

@lunny
Copy link
Member

lunny commented Mar 1, 2014

Sync函数没有缓存,每次都是重新从数据库查询。

在 2014年3月1日,22:15,S.W.H notifications@github.com 写道:

难道是缓存?有没有重启过应用?


Reply to this email directly or view it on GitHub.

@yaotian
Copy link
Author

yaotian commented Mar 2, 2014

重启了

发自我的 iPhone

在 2014年3月1日,下午10:15,"S.W.H" notifications@github.com 写道:

难道是缓存?有没有重启过应用?


Reply to this email directly or view it on GitHub.

@lunny lunny self-assigned this Apr 8, 2014
@lunny
Copy link
Member

lunny commented Sep 8, 2014

尝试下使用engine.Sync2试一下?

@lunny
Copy link
Member

lunny commented Feb 22, 2015

这个bug应该已经被解决了。

@lunny lunny closed this as completed Feb 22, 2015
@lunny lunny added the kind/bug label Feb 22, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants