0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-09 21:45:25 +08:00
discourse/migrations/tooling/spec
Gerhard Schlager 2e9fb130ac MT: Key embed placeholder tables by owner instead of post
The placeholder linkage tables were keyed by post_id, but placeholders
will be needed in other markdown fields too (user bios, group and
category descriptions). This renames post_* to embed_* and keys them by
owner_type + owner_id, so the same tables and the same import-time
resolution work for any markdown-bearing record.

- owner_type is an integer-backed enum (embed_owner: post=1, user=2):
  readable constants in code, 0-1 bytes per row in SQLite instead of a
  repeated text tag.
- embed_links: target_topic_id/target_post_id replaced by a generic
  target_type (enum link_target) + target_id, so future link kinds
  (user, category, tag, ...) don't need new columns.
- EmbedBuffer takes owner_type at construction; steps keep calling
  write_for(id).
- PlaceholderResolver serves one owner kind per instance and reports
  unresolved and orphaned embeds with owner-aware URLs.

[ci skip]
2026-07-08 22:35:55 +02:00
..
fixtures/schema
lib/migrations/tooling MT: Key embed placeholder tables by owner instead of post 2026-07-08 22:35:55 +02:00
spec_helper.rb