- DBA::update('item', ['author-id' => $first], ['author-id' => $dup_id]);
- DBA::update('item', ['owner-id' => $first], ['owner-id' => $dup_id]);
- DBA::update('thread', ['author-id' => $first], ['author-id' => $dup_id]);
- DBA::update('thread', ['owner-id' => $first], ['owner-id' => $dup_id]);
+ DBA::update('post-tag', ['cid' => $new_cid], ['cid' => $old_cid]);
+ DBA::delete('post-tag', ['cid' => $old_cid]);
+ foreach (['item', 'post', 'post-thread', 'post-user', 'post-thread-user'] as $table) {
+ if (DBStructure::existsTable($table)) {
+ DBA::update($table, ['author-id' => $new_cid], ['author-id' => $old_cid]);
+ DBA::update($table, ['owner-id' => $new_cid], ['owner-id' => $old_cid]);
+ DBA::update($table, ['causer-id' => $new_cid], ['causer-id' => $old_cid]);
+ }
+ }
+ if (DBStructure::existsTable('thread')) {
+ DBA::update('thread', ['author-id' => $new_cid], ['author-id' => $old_cid]);
+ DBA::update('thread', ['owner-id' => $new_cid], ['owner-id' => $old_cid]);
+ }