It is my expectation that when I remove a revision that all information of that revision is removed... In this case, I've done the following
$updated_revisions = $connection->select('node_revision', 'nr')
->fields('nr', array('nid', 'vid'))
->condition('nr.revision_timestamp', '1465595835', '>=')
->orderBy('vid')
->execute()
->fetchAll();
$node_storage = \Drupal::entityTypeManager()->getStorage('node');
$node_list = array();
foreach ($updated_revisions as $row) {
if (!in_array($row->nid, $node_list)) {
$node_list[] = $row->nid;
}
$revision = $node_storage->loadRevision($row->vid);
$revision->setNewRevision();
$revision->save();
$node_storage->deleteRevision($row->vid);
}
After doing so I have the following
mysql> select * from node_field_revision where nid >= 60000; +-------+--------+----------+-------------------------+-------+--------+------------+------------+---------+--------+-------------------------------+------------------+ | nid | vid | langcode | title | uid | status | created | changed | promote | sticky | revision_translation_affected | default_langcode | +-------+--------+----------+-------------------------+-------+--------+------------+------------+---------+--------+-------------------------------+------------------+ | 60001 | 101045 | en | LIVING IN NEW YORK CITY | 27552 | 1 | 1465835307 | 1465835429 | 0 | 0 | 1 | 1 | | 60001 | 101046 | en | LIVING IN NEW YORK CITY | 27552 | 1 | 1465835307 | 1465836518 | 0 | 0 | 1 | 1 | | 60001 | 101047 | en | Where to Live | 27552 | 1 | 1465835307 | 1465836603 | 0 | 0 | 1 | 1 | | 60001 | 200006 | en | LIVING IN NEW YORK CITY | 27552 | 1 | 1465835307 | 1465835429 | 0 | 0 | 1 | 1 | | 60001 | 200007 | en | LIVING IN NEW YORK CITY | 27552 | 1 | 1465835307 | 1465836518 | 0 | 0 | 1 | 1 | | 60001 | 200008 | en | Where to Live | 27552 | 1 | 1465835307 | 1466540679 | 0 | 0 | 1 | 1 | | 60002 | 101048 | en | Classroom | 27552 | 1 | 1465836841 | 1465838185 | 0 | 0 | 1 | 1 | | 60002 | 101060 | en | Classroom | 27552 | 1 | 1465836841 | 1466179518 | 0 | 0 | 1 | 1 | | 60002 | 101061 | en | Classroom | 27552 | 1 | 1465836841 | 1466179704 | 0 | 0 | 1 | 1 | | 60002 | 200009 | en | Classroom | 27552 | 1 | 1465836841 | 1465838185 | 0 | 0 | 1 | 1 | | 60002 | 200021 | en | Classroom | 27552 | 1 | 1465836841 | 1466179518 | 0 | 0 | 1 | 1 | | 60002 | 200022 | en | Classroom | 27552 | 1 | 1465836841 | 1466540679 | 0 | 0 | 1 | 1 | | 60003 | 101049 | en | Classroom | 27552 | 1 | 1465836841 | 1465838208 | 0 | 0 | 1 | 1 | | 60003 | 200010 | en | Classroom | 27552 | 1 | 1465836841 | 1466540679 | 0 | 0 | 1 | 1 | | 60004 | 101050 | en | Post a position | 27552 | 1 | 1465838562 | 1465838869 | 0 | 0 | 1 | 1 | | 60004 | 200011 | en | Post a position | 27552 | 1 | 1465838562 | 1466540679 | 0 | 0 | 1 | 1 | | 60005 | 101051 | en | /student/life | 1 | 1 | 1465926342 | 1465926388 | 0 | 0 | 1 | 1 | | 60005 | 101052 | en | /student/life | 1 | 1 | 1465926342 | 1465928313 | 0 | 0 | 1 | 1 | | 60005 | 200012 | en | /student/life | 1 | 1 | 1465926342 | 1465926388 | 0 | 0 | 1 | 1 | | 60005 | 200013 | en | /student/life | 1 | 1 | 1465926342 | 1466540679 | 0 | 0 | 1 | 1 | | 60006 | 101053 | en | /student/orgs | 1 | 1 | 1465928403 | 1465928425 | 0 | 0 | 1 | 1 | | 60006 | 200014 | en | /student/orgs | 1 | 1 | 1465928403 | 1466540679 | 0 | 0 | 1 | 1 | | 60007 | 101054 | en | /student/orgs | 1 | 1 | 1465928403 | 1465928445 | 0 | 0 | 1 | 1 | | 60007 | 101055 | en | /student/orgs | 1 | 1 | 1465928403 | 1465931587 | 0 | 0 | 1 | 1 | | 60007 | 200015 | en | /student/orgs | 1 | 1 | 1465928403 | 1465928445 | 0 | 0 | 1 | 1 | | 60007 | 200016 | en | /student/orgs | 1 | 1 | 1465928403 | 1466540679 | 0 | 0 | 1 | 1 | | 60008 | 101056 | en | VICTOR RODWIN RESEARCH | 27552 | 1 | 1466001552 | 1466007126 | 0 | 0 | 1 | 1 | | 60008 | 200017 | en | VICTOR RODWIN RESEARCH | 27552 | 1 | 1466001552 | 1466540679 | 0 | 0 | 1 | 1 | | 60009 | 101057 | en | WORLD CITIES PROJECT | 27552 | 1 | 1466007157 | 1466007184 | 0 | 0 | 1 | 1 | | 60009 | 200018 | en | WORLD CITIES PROJECT | 27552 | 1 | 1466007157 | 1466540679 | 0 | 0 | 1 | 1 | +-------+--------+----------+-------------------------+-------+--------+------------+------------+---------+--------+-------------------------------+------------------+ 30 rows in set (0.00 sec)
mysql> select * from node_revision where nid >= 60000; +-------+--------+----------+--------------------+--------------+--------------+ | nid | vid | langcode | revision_timestamp | revision_uid | revision_log | +-------+--------+----------+--------------------+--------------+--------------+ | 60001 | 200006 | en | 1465835429 | 27552 | NULL | | 60001 | 200007 | en | 1465836518 | 1 | NULL | | 60001 | 200008 | en | 1465836603 | 1 | NULL | | 60002 | 200009 | en | 1465838185 | 27552 | NULL | | 60002 | 200021 | en | 1466179518 | 1077 | NULL | | 60002 | 200022 | en | 1466179704 | 1077 | NULL | | 60003 | 200010 | en | 1465838208 | 27552 | NULL | | 60004 | 200011 | en | 1465838869 | 27552 | NULL | | 60005 | 200012 | en | 1465926388 | 1 | NULL | | 60005 | 200013 | en | 1465928313 | 1 | NULL | | 60006 | 200014 | en | 1465928425 | 1 | NULL | | 60007 | 200015 | en | 1465928445 | 1 | NULL | | 60007 | 200016 | en | 1465931587 | 1 | NULL | | 60008 | 200017 | en | 1466007126 | 27552 | NULL | | 60009 | 200018 | en | 1466007184 | 27552 | NULL | +-------+--------+----------+--------------------+--------------+--------------+ 15 rows in set (0.00 sec)
Note there are twice as many node_field_revision records.