Commit Graph

4 Commits

Author SHA1 Message Date
silverwind
ed0ed680cf Document the SQLite skip in v332
Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
2026-05-03 14:32:39 +05:30
silverwind
d18464fd58 Tighten v332 migration cleanup pass
- Use setting.Database.Type.IsSQLite3() / IsMySQL() for dialect checks
  to match the rest of models/migrations/.
- Trim the migration's comment to the load-bearing why (MSSQL rejects
  inline DEFAULT, MySQL drops it on MODIFY COLUMN), drop the discovery
  narrative.
- Trim test comments and tighten the type-name assertion list to the
  values dialects actually emit (verified empirically against the CI
  image versions: MySQL/MSSQL report "INT", Postgres reports "INTEGER";
  "INT4" never surfaces, removed).

Re-tested against postgres:14, bitnamilegacy/mysql:8.0, mssql:2019-latest,
and SQLite — all pass.

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
2026-05-03 14:32:39 +05:30
silverwind
d6ae7c1c50 Simplify v332 migration and add cross-DB test
Tested against the CI image versions (postgres:14, bitnamilegacy/mysql:8.0,
mcr.microsoft.com/mssql/server:2019-latest) plus SQLite. Both the original
implementation (per-dialect SQL) and a naive `base.ModifyColumn` with
`DefaultIsEmpty: false` were tried. Findings:

- DefaultIsEmpty: false fails on MSSQL with "Incorrect syntax near the
  keyword 'DEFAULT'" because MSSQL's ALTER COLUMN does not accept inline
  DEFAULT (it lives in a separate constraint object).
- DefaultIsEmpty: true succeeds on MSSQL (existing default constraint
  unaffected) and Postgres (DEFAULT constraint is independent of TYPE)
  but drops the DEFAULT on MySQL because MODIFY COLUMN rewrites all
  column attributes.

Settled on the minimal cross-DB form: base.ModifyColumn with
DefaultIsEmpty: true to widen the type, then a MySQL-only follow-up
`ALTER ... SET DEFAULT 0` to restore the default that MODIFY COLUMN drops.

The new test seeds rows at the int8 boundary (0 and 127), runs the
migration, asserts the column type widened, the rows preserved, and that
inserting a value > 127 succeeds afterward.

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
2026-05-03 14:32:38 +05:30
silverwind
45832f4d68 Address remaining review feedback
- Use ParseIssueFilterStateIsClosed for ListProjects state parsing
- Add SortTypeProjectColumnSorting const, replace magic string
- Use GetIssueByRepoID and dedupe Add/Remove issue handlers
- Migrate Column.Sorting from int8 to int (drops 127-column limit, allows
  the API to expose a normal int without truncation)
- Introduce project_service.UpdateProject with optional.Option fields,
  use it from the API EditProject handler

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
2026-05-03 14:32:37 +05:30