Fix tokens table migration

This commit is contained in:
Nicolas Le Goff
2014-03-13 23:30:04 +01:00
parent 6421508551
commit a23bf7a4ac

View File

@@ -60,10 +60,19 @@ class patch_390alpha15a extends patchAbstract
return true; return true;
} }
$sql = 'INSERT INTO Tokens $app['EM']->getConnection()->executeUpdate('
(value, user_id, type, data, created, updated, expiration) INSERT INTO Tokens
(SELECT value, usr_id, type, datas, created_on, created_on, expire_on FROM tokens_backup)'; (
$appbox->get_connection()->exec($sql); `value`, user_id, `type`, `data`,
created, updated, expiration
)
(
SELECT
tb.`value`, tb.usr_id, tb.`type`, tb.datas,
tb.created_on, tb.created_on, tb.expire_on
FROM tokens_backup tb
INNER JOIN Users u ON (u.id = tb.usr_id)
)');
return true; return true;
} }