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

创建数据迁移报错 #776

Open
liaokylin opened this issue Nov 7, 2023 · 3 comments
Open

创建数据迁移报错 #776

liaokylin opened this issue Nov 7, 2023 · 3 comments
Labels

Comments

@liaokylin
Copy link

Reproduction link

https://github.com/go-admin-team/go-admin.git

Steps to reproduce

./go-admin.exe migrate -c config/settings.yml

What is expected?

What is actually happening?

CREATE UNIQUE INDEX idx_sys_casbin_rule ON sys_casbin_rule (ptype,v0,v1,v2,v3,v4,v5,v6,v7)
panic: Error 1071 (42000): Specified key was too long; max key length is 1000 bytes

Environment Info
go-admin undefined
Go 1.21
System win10
Browser chrome
@wenjianzhang
Copy link
Member

you can try using the latest version, or adjust the database configuration according to the error prompts

@frankykong
Copy link

start init
2024-07-24 23:58:12.860+0800 info * => demouser:123456@localhost:5432/goadmin?sslmode=false
2024-07-24 23:58:12.865+0800 [email protected]/gorm.go:211 error /home/frank/go/pkg/mod/github.com/go-admin-team/[email protected]/tools/database/config.go:39 [error] failed to initialize database, got error failed to connect to host=/var/run/postgresql user=frank database=: failed SASL auth (FATAL: password authentication failed for user "frank" (SQLSTATE 28P01))
2024-07-24 23:58:12.865+0800 fatal postgres connect error :failed to connect to host=/var/run/postgresql user=frank database=: failed SASL auth (FATAL: password authentication failed for user "frank" (SQLSTATE 28P01))

why I ty ro run: ./go-admin migrate -c config/settings.yml . it show up with the error message? why the code try to connect the database with the user name 'frank' ? I have been set the db source correctly.

@frankykong
Copy link

sorry about that, i fixed that myself. I set the driver key to 'postgres', It should be 'postgresql' . the example is wrong.
After that, I got another error :
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x122aa75]

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

No branches or pull requests

3 participants