mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 16:52:41 +01:00
Allow lisk to preserve primary autoincrement keys so I can migrate a billion
zillion rows without disrupting four years of history.
This commit is contained in:
parent
c797f9511a
commit
73bf36505b
1 changed files with 7 additions and 3 deletions
|
@ -794,10 +794,14 @@ abstract class LiskDAO {
|
|||
|
||||
$id_mechanism = $this->getConfigOption(self::CONFIG_IDS);
|
||||
switch ($id_mechanism) {
|
||||
// If we are using autoincrement IDs, let MySQL assign the value for the
|
||||
// ID column.
|
||||
case self::IDS_AUTOINCREMENT:
|
||||
unset($data[$this->getIDKeyForUse()]);
|
||||
// If we are using autoincrement IDs, let MySQL assign the value for the
|
||||
// ID column, if it is empty. If the caller has explicitly provided a
|
||||
// value, use it.
|
||||
$id_key = $this->getIDKeyForUse();
|
||||
if (empty($data[$id_key])) {
|
||||
unset($data[$id_key]);
|
||||
}
|
||||
break;
|
||||
case self::IDS_PHID:
|
||||
if (empty($data[$this->getIDKeyForUse()])) {
|
||||
|
|
Loading…
Reference in a new issue