Commit 2751bb4
committed
fix(schema): drop PARTITIONS N from PostgreSQL hash partitioning
The shared Schema\Trait\Partitioning emits `PARTITIONS N` after the
PARTITION BY clause when a count is set — but that's MySQL-only
syntax. PostgreSQL rejects it: hash partitions are declared with
separate `CREATE TABLE … PARTITION OF parent FOR VALUES WITH
(modulus N, remainder R)` statements.
Override compileCreatePartitioning in Schema\PostgreSQL to omit the
count clause so $table->partitionByHash($expr, 4) silently drops the
4 instead of generating invalid DDL.
Includes a regression test asserting the count is not emitted.1 parent 69ed516 commit 2751bb4
3 files changed
Lines changed: 34 additions & 0 deletions
File tree
- .claude
- src/Query/Schema
- tests/Query/Schema
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
588 | 588 | | |
589 | 589 | | |
590 | 590 | | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
591 | 606 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1028 | 1028 | | |
1029 | 1029 | | |
1030 | 1030 | | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
1031 | 1049 | | |
1032 | 1050 | | |
1033 | 1051 | | |
| |||
0 commit comments