nightingale
nightingale copied to clipboard
[DB]配置项 TablePrefix 不生效
Your config.toml
[DB]
# postgres: host=%s port=%s user=%s dbname=%s password=%s sslmode=%s
# postgres: DSN="host=127.0.0.1 port=5432 user=root dbname=n9e_v6 password=1234 sslmode=disable"
DSN = "root:1234@tcp(127.0.0.1:3306)/n9e_v6?charset=utf8mb4&parseTime=True&loc=Local&allowNativePasswords=true"
# enable debug mode or not
Debug = false
# mysql postgres
DBType = "mysql"
# unit: s
MaxLifetime = 7200
# max open connections
MaxOpenConns = 150
# max idle connections
MaxIdleConns = 50
# table prefix
TablePrefix = "someprefix_"
# enable auto migrate or not
# EnableAutoMigrate = false
Relevant logs
2024-04-08 17:04:29.847451 ERROR ormx/ormx.go:66 /home/runner/work/nightingale/nightingale/models/common.go:21 Error 1146: Table 'n9e_v6.role_operation' doesn't exist
[0.254ms] [rows:0] SELECT count(*) FROM `role_operation` WHERE operation = '/alert-mutes/put' and role_name = 'Standard'
2024-04-08 17:04:29.847538 ERROR migrate/migrate.go:132 check role operation exists failed, Error 1146: Table 'n9e_v6.role_operation' doesn't exist
2024-04-08 17:04:29.847799 ERROR ormx/ormx.go:66 /home/runner/work/nightingale/nightingale/models/common.go:21 Error 1146: Table 'n9e_v6.role_operation' doesn't exist
[0.233ms] [rows:0] SELECT count(*) FROM `role_operation` WHERE operation = '/log/index-patterns' and role_name = 'Standard'
2024-04-08 17:04:29.847820 ERROR migrate/migrate.go:132 check role operation exists failed, Error 1146: Table 'n9e_v6.role_operation' doesn't exist
2024-04-08 17:04:29.848052 ERROR ormx/ormx.go:66 /home/runner/work/nightingale/nightingale/models/common.go:21 Error 1146: Table 'n9e_v6.role_operation' doesn't exist
[0.204ms] [rows:0] SELECT count(*) FROM `role_operation` WHERE operation = '/help/variable-configs' and role_name = 'Standard'
2024-04-08 17:04:29.848064 ERROR migrate/migrate.go:132 check role operation exists failed, Error 1146: Table 'n9e_v6.role_operation' doesn't exist
2024-04-08 17:04:29.848263 ERROR ormx/ormx.go:66 /home/runner/work/nightingale/nightingale/models/common.go:21 Error 1146: Table 'n9e_v6.role_operation' doesn't exist
[0.176ms] [rows:0] SELECT count(*) FROM `role_operation` WHERE operation = '/permissions' and role_name = 'Admin'
2024-04-08 17:04:29.848290 ERROR migrate/migrate.go:132 check role operation exists failed, Error 1146: Table 'n9e_v6.role_operation' doesn't exist
2024-04-08 17:04:29.848516 ERROR ormx/ormx.go:66 /home/runner/work/nightingale/nightingale/models/common.go:21 Error 1146: Table 'n9e_v6.role_operation' doesn't exist
[0.205ms] [rows:0] SELECT count(*) FROM `role_operation` WHERE operation = '/ibex-settings' and role_name = 'Standard'
2024-04-08 17:04:29.848543 ERROR migrate/migrate.go:132 check role operation exists failed, Error 1146: Table 'n9e_v6.role_operation' doesn't exist
2024-04-08 17:04:29.850073 ERROR ormx/ormx.go:66 /home/runner/work/nightingale/nightingale/models/user.go:227 Error 1146: Table 'n9e_v6.users' doesn't exist
System info
n9e 7.0.0-beta.2
Steps to reproduce
- æ TablePrefix 建表: CREATE TABLE IF NOT EXISTS
someprefix_user_group
( - 以 TablePrefix = "someprefix_" å¯å¨ n9e
- æ¥é, æ æ³å¯å¨
Expected behavior
访é®è¡¨å: someprefix_role_operation
Actual behavior
访é®è¡¨å: role_operation
Additional info
ægormçå®ç°, å¦æmodelå®ä¹äº TableName() åä¼å 使ç¨, å¯¼è´ NamingStrategy ä¸çæ
https://github.com/ccfos/nightingale/compare/main...igotcha:nightingale:main 这样应该就可以了
暂时还没人力调整这块哈