Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

求SQL语句 #2

Open
niuweiming opened this issue May 25, 2024 · 7 comments
Open

求SQL语句 #2

niuweiming opened this issue May 25, 2024 · 7 comments

Comments

@niuweiming
Copy link

有没有建表的sql语句啊?

@limitcool
Copy link
Owner

不需要建表语句,gorm (AutoMigrate )自动迁移。

@niuweiming
Copy link
Author

自动迁移会报错

@niuweiming
Copy link
Author

项目目前只有后端没有前端是吧!

@limitcool
Copy link
Owner

报错发下我看看,是的只有后端没有前端,后端基本上也很多查询的功能都没写,我有一个rust版的写的比较全。

@niuweiming
Copy link
Author

报错我解决了,我用go的结构体,让gpt反向生成sql,写完了,报错大概就是表和表之间有依赖,但是建表的顺序可能有问题,导致这个表要用那个表的键,而那个表没建好

@niuweiming
Copy link
Author

原来是rust佬

@limitcool
Copy link
Owner

可能是AutoMigrate 里面的结构体不全,改一下迁移顺序补充下就行了。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants