claude@clouddev1
abce1188f2
constraints: add constraint / drop constraint on existing columns (ADR-0029 §2.2)
...
Adds the two commands for modifying a column's constraints after
creation, completing ADR-0029's §2.2 surface.
Grammar (dsl/grammar/ddl.rs): `add constraint <constraint> to
<T>.<col>` reuses the §2.1 COLUMN_CONSTRAINT choice; `drop
constraint <kind> from <T>.<col>` names only the kind. Both join
the `add` / `drop` choices, discriminated by the `constraint`
form word.
AST (dsl/command.rs): `Command::AddConstraint` / `DropConstraint`
plus the `Constraint` / `ConstraintKind` enums.
Worker (db.rs): `do_add_constraint` / `do_drop_constraint` apply
the change through the rebuild-table primitive. `add` runs the §5
dry-run first — `not null` / `unique` / `check` against a
populated column are refused, before any write, with a
pretty-printed table of offending rows. §9 redundant-on-PK
declarations and §6 `default` on an auto-generated column are
friendly refusals; dropping a constraint the column does not
carry is likewise refused.
Also fixes schema_to_ddl, which suppressed UNIQUE for every PK
column — a compound-PK member is not individually unique, so an
explicit UNIQUE on it must survive the rebuild.
23 tests added (6 grammar, 17 worker); 3 completion-test and 3
matrix snapshots updated for the new `constraint` subcommand.
2026-05-19 18:31:57 +00:00
..
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-19 18:31:57 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 21:29:54 +00:00
2026-05-15 21:29:54 +00:00
2026-05-15 21:29:54 +00:00
2026-05-15 21:29:54 +00:00
2026-05-15 21:29:54 +00:00
2026-05-15 21:29:54 +00:00
2026-05-15 21:29:54 +00:00
2026-05-15 21:29:54 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-18 21:51:52 +00:00
2026-05-18 21:51:52 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-18 21:51:52 +00:00
2026-05-18 21:51:52 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:34:01 +00:00
2026-05-15 20:34:01 +00:00
2026-05-15 20:34:01 +00:00
2026-05-15 20:34:01 +00:00
2026-05-15 20:34:01 +00:00
2026-05-15 20:34:01 +00:00
2026-05-18 23:12:33 +00:00
2026-05-18 23:12:33 +00:00
2026-05-15 20:34:01 +00:00
2026-05-18 23:12:33 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-19 12:49:58 +00:00
2026-05-19 12:49:58 +00:00
2026-05-19 12:49:58 +00:00
2026-05-19 12:49:58 +00:00
2026-05-19 12:49:58 +00:00
2026-05-19 12:49:58 +00:00
2026-05-19 12:49:58 +00:00
2026-05-19 12:49:58 +00:00
2026-05-19 12:49:58 +00:00
2026-05-19 12:49:58 +00:00
2026-05-19 12:49:58 +00:00
2026-05-19 12:49:58 +00:00
2026-05-19 12:49:58 +00:00
2026-05-16 00:15:55 +00:00
2026-05-16 00:15:55 +00:00
2026-05-19 18:31:57 +00:00
2026-05-19 18:31:57 +00:00
2026-05-16 00:15:55 +00:00
2026-05-16 00:15:55 +00:00
2026-05-16 00:15:55 +00:00
2026-05-16 00:15:55 +00:00
2026-05-15 20:06:58 +00:00
2026-05-15 20:06:58 +00:00
2026-05-15 20:06:58 +00:00
2026-05-15 20:06:58 +00:00
2026-05-15 20:06:58 +00:00
2026-05-15 22:27:53 +00:00
2026-05-15 22:27:53 +00:00
2026-05-15 22:27:53 +00:00
2026-05-15 20:06:58 +00:00
2026-05-15 20:06:58 +00:00
2026-05-15 20:06:58 +00:00
2026-05-15 20:06:58 +00:00
2026-05-15 20:06:58 +00:00
2026-05-15 20:06:58 +00:00
2026-05-15 20:06:58 +00:00
2026-05-15 20:06:58 +00:00
2026-05-15 20:06:58 +00:00
2026-05-15 20:06:58 +00:00
2026-05-15 20:06:58 +00:00
2026-05-15 22:27:53 +00:00
2026-05-15 20:06:58 +00:00
2026-05-15 22:27:53 +00:00
2026-05-15 20:06:58 +00:00
2026-05-15 20:31:01 +00:00
2026-05-15 21:30:03 +00:00
2026-05-15 20:31:01 +00:00
2026-05-15 20:31:01 +00:00
2026-05-15 21:30:03 +00:00
2026-05-15 21:30:03 +00:00
2026-05-15 21:30:03 +00:00
2026-05-15 20:31:01 +00:00
2026-05-15 20:31:01 +00:00
2026-05-15 20:31:01 +00:00
2026-05-15 21:30:03 +00:00
2026-05-15 21:30:03 +00:00
2026-05-15 20:31:01 +00:00
2026-05-15 20:31:01 +00:00
2026-05-15 21:30:03 +00:00
2026-05-15 20:31:01 +00:00
2026-05-15 22:27:53 +00:00
2026-05-15 22:27:53 +00:00
2026-05-15 22:27:53 +00:00
2026-05-15 22:27:53 +00:00
2026-05-15 22:27:53 +00:00
2026-05-15 22:27:53 +00:00
2026-05-15 20:34:01 +00:00
2026-05-15 22:27:53 +00:00
2026-05-15 20:34:01 +00:00
2026-05-15 22:27:53 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:50:56 +00:00
2026-05-15 20:34:01 +00:00
2026-05-15 20:34:01 +00:00
2026-05-15 20:34:01 +00:00
2026-05-15 20:34:01 +00:00
2026-05-15 20:34:01 +00:00
2026-05-15 20:34:01 +00:00
2026-05-15 20:34:01 +00:00
2026-05-15 20:34:01 +00:00
2026-05-15 20:34:01 +00:00
2026-05-15 20:34:01 +00:00
2026-05-15 20:34:01 +00:00
2026-05-15 20:34:01 +00:00
2026-05-18 23:12:33 +00:00
2026-05-18 23:12:33 +00:00
2026-05-15 20:34:01 +00:00
2026-05-15 20:34:01 +00:00
2026-05-18 23:19:53 +00:00
2026-05-18 23:19:53 +00:00
2026-05-18 23:19:53 +00:00
2026-05-18 23:19:53 +00:00
2026-05-18 23:19:53 +00:00
2026-05-19 09:39:58 +00:00
2026-05-18 23:19:53 +00:00
2026-05-18 23:19:53 +00:00
2026-05-18 23:19:53 +00:00