mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-27 12:17:08 +00:00
Two statements failed server-side on every panel start after a SQLite to Postgres migration, flooding the postgres log even though the Go side suppressed them: - resyncPostgresSequences issued SELECT MAX(id) against client_inbounds, whose composite primary key has no id column; Postgres validates the SELECT list at parse time, so the WHERE pg_get_serial_sequence(...) guard never got a chance to no-op it. Skip models whose GORM schema maps no id column before issuing the statement. - AutoMigrate detects existing columns via information_schema filtered by table_catalog = CURRENT_DATABASE(), which misdetects on some setups and re-issues ALTER TABLE ... ADD for columns that already exist. HasColumn/ HasIndex query without that filter and are reliable (the existing duplicate-column suppressor depends on exactly that), so skip AutoMigrate outright when the table, every column, and every index already exist. Closes #5665 |
||
|---|---|---|
| .. | ||
| model | ||
| api_token_timestamp_test.go | ||
| db.go | ||
| db_seed_test.go | ||
| db_settled_test.go | ||
| dialect.go | ||
| dump_sqlite.go | ||
| dump_sqlite_test.go | ||
| host_migration_test.go | ||
| host_test.go | ||
| index_tags_test.go | ||
| migrate_data.go | ||
| migrate_data_test.go | ||
| settings_index_test.go | ||
| wireguard_migration_test.go | ||