fix: align message revision schema with tenant databases

This commit is contained in:
richjohnrambo
2026-08-17 14:54:50 +08:00
parent e14dec9af7
commit b7a5d5cb17
+1 -3
View File
@@ -1395,7 +1395,6 @@ func upgradeIMMessageActions(a *adapter) error {
"ALTER TABLE im_messages ADD COLUMN recalled_by BIGINT AFTER recalled_at",
`CREATE TABLE im_message_revisions(
id BIGINT NOT NULL AUTO_INCREMENT,
tenant_id BIGINT NOT NULL,
createdat DATETIME(3) NOT NULL,
updatedat DATETIME(3) NOT NULL,
topic CHAR(25) NOT NULL,
@@ -1406,8 +1405,7 @@ func upgradeIMMessageActions(a *adapter) error {
content JSON,
reason VARCHAR(256) NOT NULL DEFAULT '',
PRIMARY KEY(id),
UNIQUE INDEX uk_im_message_revisions_version(tenant_id, topic, seqid, version),
CONSTRAINT fk_im_message_revisions_tenant FOREIGN KEY(tenant_id) REFERENCES im_tenant(id) ON DELETE CASCADE
UNIQUE INDEX uk_im_message_revisions_version(topic, seqid, version)
)`,
}
for _, stmt := range statements {