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

Error 1054 (42S22): Unknown column 'user_follow.deleted_at' in 'where… #568

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zishiguo
Copy link

… clause'

Explain your user case and expected results

Error 1054 (42S22): Unknown column 'user_follow.deleted_at' in 'where clause'

@@ -50,6 +48,15 @@ func OpenTestConnection() (db *gorm.DB, err error) {
dbDSN = "gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8&parseTime=True&loc=Local"
}
db, err = gorm.Open(mysql.Open(dbDSN), &gorm.Config{})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

db and DB

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what you mean

Copy link

@huacnlee huacnlee Feb 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/go-gorm/sharding/blob/main/examples/order.go
https://github.com/go-gorm/sharding/blob/main/sharding_test.go

Checkout the difference with this file. You may have a mistake, but I can find it.

Copy link
Author

@zishiguo zishiguo Feb 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I can't find my mistake.
function OpenTestConnection return db, then it is assigned to global variable DB.

func OpenTestConnection() (db *gorm.DB, err error)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I add you on wechat or qq ?

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

Successfully merging this pull request may close these issues.

None yet

2 participants