mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-11-09 05:24:49 +09:00
The id column was declared BigInteger, which on SQLite is NOT a rowid alias so it never autoincrements — every metrics insert failed with "NOT NULL constraint failed: server_metrics.id" and the dashboard silently sat at zero once an agent sent heartbeats. The model was already fixed to Integer, but db.create_all() doesn't ALTER existing tables, so deployed SQLite installs stayed broken. This migration detects the wrong column type on SQLite and rebuilds the table (historical samples are disposable); Postgres/MySQL are left untouched where BIGINT autoincrement works. Chains off 007. Recovered from a local stash. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>