Mike Bridge
9465e3b675
fix(migration): explicit NOT NULL on FK columns for SQLite (sc-105349)
...
Found by running fresh-install + round-trip against a real SQLite DB:
6 of the 8 affected tables had FK columns that were originally
declared nullable. PostgreSQL and MySQL implicitly promote the
constituent columns of an ``ALTER TABLE ... ADD PRIMARY KEY`` to
``NOT NULL``; SQLite does not (it's a long-standing SQLite quirk —
only ``INTEGER PRIMARY KEY`` enforces NOT NULL on a composite-PK
column). Result: a fresh SQLite install would accept
``INSERT INTO dashboard_slices (NULL, 5)`` despite both columns
being part of the composite PK.
Our integration tests previously masked this: the test fixture seeds
columns with ``nullable=False``, so the post-upgrade NOT NULL
assertion passed regardless of whether the migration enforced it.
Fix: add explicit ``batch_op.alter_column(fk, nullable=False)`` for
both FK columns inside the per-table batch_alter_table block. On
PostgreSQL and MySQL this is a no-op (PK already implies NOT NULL);
on SQLite it adds the missing NOT NULL declaration so a fresh
install matches the data-model.md "After" contract.
Verified end-to-end:
- Postgres + MySQL: column shape unchanged (still NOT NULL)
- SQLite fresh install + round-trip: all 8 tables now have NOT NULL
on FK columns, ``INSERT (NULL, 5)`` correctly rejected with
IntegrityError on dashboard_slices, dashboard_user, sqlatable_user
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 18:42:05 -06:00
..
2025-04-14 19:01:11 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-12-18 17:41:34 -08:00
2025-04-14 19:01:11 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-04-14 19:01:11 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-04-14 19:01:11 -07:00
2024-04-24 17:19:53 -07:00
2025-04-14 19:01:11 -07:00
2024-12-18 17:41:34 -08:00
2024-04-24 17:19:53 -07:00
2024-12-18 17:41:34 -08:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-12-18 17:41:34 -08:00
2025-04-14 19:01:11 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-08-02 12:19:50 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-12-18 17:41:34 -08:00
2024-04-24 17:19:53 -07:00
2025-04-14 19:01:11 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-04-14 19:01:11 -07:00
2024-12-18 17:41:34 -08:00
2024-04-24 17:19:53 -07:00
2025-08-02 12:19:50 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-08-02 12:19:50 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-04-14 19:01:11 -07:00
2024-05-28 14:17:41 -07:00
2024-04-24 17:19:53 -07:00
2024-05-28 14:17:41 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-08-02 12:19:50 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-04-14 19:01:11 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-08-02 12:19:50 -07:00
2024-05-28 14:17:41 -07:00
2024-05-28 14:17:41 -07:00
2024-05-28 14:17:41 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-05-28 14:17:41 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-08-02 12:19:50 -07:00
2025-04-14 19:01:11 -07:00
2024-12-18 17:41:34 -08:00
2024-12-18 17:41:34 -08:00
2024-12-18 17:41:34 -08:00
2024-12-18 17:41:34 -08:00
2024-12-18 17:41:34 -08:00
2024-12-18 17:41:34 -08:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-12-18 17:41:34 -08:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-12-18 17:41:34 -08:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-12-18 17:41:34 -08:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-09-15 12:42:49 -07:00
2024-04-24 17:19:53 -07:00
2025-04-14 19:01:11 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-05-28 14:17:41 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-05-28 14:17:41 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-05-28 14:17:41 -07:00
2024-04-24 17:19:53 -07:00
2025-08-02 12:19:50 -07:00
2025-04-14 19:01:11 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-04-14 19:01:11 -07:00
2024-04-24 17:19:53 -07:00
2025-09-15 12:42:49 -07:00
2024-12-18 17:41:34 -08:00
2024-12-18 17:41:34 -08:00
2024-04-24 17:19:53 -07:00
2025-04-14 19:01:11 -07:00
2024-12-18 17:41:34 -08:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-04-14 19:01:11 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-09-15 12:42:49 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-04-14 19:01:11 -07:00
2025-04-14 19:01:11 -07:00
2024-04-24 17:19:53 -07:00
2024-12-18 17:41:34 -08:00
2024-04-24 17:19:53 -07:00
2025-02-24 11:26:45 -07:00
2025-04-14 19:01:11 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-04-14 19:01:11 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-30 18:29:49 -07:00
2025-04-14 19:01:11 -07:00
2024-05-28 14:17:41 -07:00
2024-12-18 17:41:34 -08:00
2024-05-28 14:17:41 -07:00
2024-05-28 14:17:41 -07:00
2025-08-02 12:19:50 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-05-28 14:17:41 -07:00
2025-04-14 19:01:11 -07:00
2024-04-24 17:19:53 -07:00
2024-05-28 14:17:41 -07:00
2024-12-18 17:41:34 -08:00
2024-06-12 13:04:42 -07:00
2024-04-24 17:19:53 -07:00
2024-06-12 13:04:42 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-08-02 12:19:50 -07:00
2024-04-24 17:19:53 -07:00
2024-06-12 13:04:42 -07:00
2025-08-02 12:19:50 -07:00
2024-04-24 17:19:53 -07:00
2025-08-02 12:19:50 -07:00
2024-04-24 17:19:53 -07:00
2024-05-28 14:17:41 -07:00
2024-12-18 17:41:34 -08:00
2024-04-24 17:19:53 -07:00
2025-08-02 12:19:50 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-09-15 12:42:49 -07:00
2024-04-24 17:19:53 -07:00
2025-09-15 12:42:49 -07:00
2024-04-24 17:19:53 -07:00
2025-04-14 19:01:11 -07:00
2024-04-24 17:19:53 -07:00
2024-12-18 17:41:34 -08:00
2025-04-14 19:01:11 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-06-04 19:31:41 -04:00
2024-05-28 14:17:41 -07:00
2024-04-24 17:19:53 -07:00
2024-05-28 14:17:41 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-12-18 17:41:34 -08:00
2024-04-24 17:19:53 -07:00
2025-04-22 11:26:54 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-05-28 14:17:41 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-07-31 19:27:42 -07:00
2024-05-28 14:17:41 -07:00
2024-12-18 17:41:34 -08:00
2024-05-28 14:17:41 -07:00
2024-05-28 14:17:41 -07:00
2025-08-02 12:19:50 -07:00
2024-04-24 17:19:53 -07:00
2024-05-28 14:17:41 -07:00
2025-08-02 12:19:50 -07:00
2025-04-14 19:01:11 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-30 18:29:49 -07:00
2025-04-22 11:26:54 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2025-04-14 19:01:11 -07:00
2025-09-15 12:42:49 -07:00
2025-09-15 12:42:49 -07:00
2025-09-15 12:42:49 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-30 18:29:49 -07:00
2024-04-24 17:19:53 -07:00
2024-04-30 18:29:49 -07:00
2024-05-28 14:17:41 -07:00
2025-04-22 11:26:54 -07:00
2024-04-30 18:29:49 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-04-24 17:19:53 -07:00
2024-09-18 17:43:22 -07:00
2024-05-13 11:55:59 -07:00
2024-12-18 17:41:34 -08:00
2025-04-22 11:26:54 -07:00
2024-12-11 10:50:56 -03:00
2024-06-12 13:04:42 -07:00
2024-12-11 10:50:56 -03:00
2024-06-12 13:04:42 -07:00
2024-06-12 13:04:42 -07:00
2024-12-11 10:50:56 -03:00
2025-04-22 11:26:54 -07:00
2024-05-06 11:54:16 -07:00
2024-05-16 12:49:31 -04:00
2024-05-16 12:49:31 -04:00
2024-05-20 11:30:56 -07:00
2024-05-16 18:10:29 -03:00
2025-09-15 12:42:49 -07:00
2025-04-14 19:01:11 -07:00
2025-08-02 12:19:50 -07:00
2025-04-14 19:01:11 -07:00
2025-04-14 19:01:11 -07:00
2025-04-14 19:01:11 -07:00
2025-04-14 19:01:11 -07:00
2025-04-14 19:01:11 -07:00
2025-04-14 19:01:11 -07:00
2025-03-26 10:29:04 -07:00
2026-02-09 10:45:56 -08:00
2025-01-07 16:35:57 -08:00
2025-01-09 16:45:05 -03:00
2025-01-28 11:09:55 +00:00
2025-03-26 10:29:04 -07:00
2025-03-19 22:47:26 +01:00
2025-04-14 20:39:09 +02:00
2025-05-01 18:16:51 -04:00
2025-09-15 12:42:49 -07:00
2025-07-25 13:26:41 -07:00
2025-07-25 13:26:41 -07:00
2025-08-12 13:27:48 -07:00
2026-05-05 12:07:46 -04:00
2025-11-14 11:57:50 +00:00
2025-11-25 14:25:24 -08:00
2026-01-16 21:58:41 -08:00
2025-12-16 18:32:29 -03:00
2026-04-08 20:14:59 -04:00
2026-03-09 16:44:56 -04:00
2026-05-19 18:42:05 -06:00