mirror of
https://github.com/discourse/discourse.git
synced 2026-08-06 13:08:40 +08:00
The per-table merge policy reads `conflict_strategy` off each model, but only the hand-written `upload` model could declare it — a generated model always got a plain `INSERT` because the generator has no notion of a conflict clause. This adds a `conflict_strategy :ignore` directive to the table DSL and threads it through to `ModelWriter`, so a generated model can opt into `INSERT OR IGNORE`: the writer emits both the `OR IGNORE` SQL and a `self.conflict_strategy` method, which is what `IntermediateDB.conflict_strategy_for` reads at run time. It defaults to `:raise` and only emits anything for `:ignore`, so every existing generated model regenerates byte-for-byte. No table uses it yet — `uploads` stays a manual model — but the option now lives in the schema config where the rest of a table's shape is declared. |
||
|---|---|---|
| .. | ||
| migrations | ||
| migrations-tooling.rb | ||