clean PMs first
This commit is contained in:
parent
37bffe0689
commit
763c00ccdf
@ -67,6 +67,8 @@ class PrivMsg extends SimpleExtension {
|
||||
|
||||
if($config->get_int("pm_version") < 2) {
|
||||
log_info("pm", "Adding foreign keys to private messages");
|
||||
$database->Execute("delete from private_message where to_id not in (select id from users);");
|
||||
$database->Execute("delete from private_message where from_id not in (select id from users);");
|
||||
$database->Execute("ALTER TABLE private_message
|
||||
ADD CONSTRAINT foreign_private_message_from_id FOREIGN KEY (from_id) REFERENCES users(id) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT foreign_private_message_to_id FOREIGN KEY (to_id) REFERENCES users(id) ON DELETE CASCADE;");
|
||||
|
Loading…
x
Reference in New Issue
Block a user