Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RemoveIndex doesn't seem to work #52

Closed
jamiefoster opened this issue Jan 16, 2014 · 2 comments
Closed

RemoveIndex doesn't seem to work #52

jamiefoster opened this issue Jan 16, 2014 · 2 comments

Comments

@jamiefoster
Copy link

This is a PostgreSQL db.
For this structure:

type User struct {
Id int64
Name string
}

this code:

db.Model(User{}).RemoveIndex("name") 

does not seem to remove the index.

@jinzhu
Copy link
Member

jinzhu commented Jan 17, 2014

Hi @jamiefoster

Yes, RemoveIndex doesn't works well yet, because there are some different behaviors between different databases.

For example, detect index exist or not. so suggest you remove index manually now. ;(

@jinzhu
Copy link
Member

jinzhu commented Jun 5, 2014

The RemoveIndex, AddIndex should works well now, please check the document as example:

https://github.com/jinzhu/gorm#indices

@jinzhu jinzhu closed this as completed Jun 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants