fix: align message revision schema with tenant databases
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user