Improve migration script
This commit is contained in:
parent
d2301e6677
commit
88767d130b
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -10,7 +10,8 @@ app/constants.php export-subst
|
|||||||
|
|
||||||
# core
|
# core
|
||||||
data/*.sqlite export-ignore
|
data/*.sqlite export-ignore
|
||||||
scripts export-ignore
|
scripts/find-locales.php export-ignore
|
||||||
|
scripts/sync-locales.php export-ignore
|
||||||
Dockerfile export-ignore
|
Dockerfile export-ignore
|
||||||
.travis.yml export-ignore
|
.travis.yml export-ignore
|
||||||
hooks export-ignore
|
hooks export-ignore
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
Miniflux - Minimalist News Reader
|
Miniflux - Minimalist News Reader
|
||||||
=================================
|
=================================
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/miniflux/miniflux.svg?branch=master)](https://travis-ci.org/miniflux/miniflux)
|
[![Build Status](https://travis-ci.org/miniflux/miniflux-legacy.svg?branch=master)](https://travis-ci.org/miniflux/miniflux-legacy)
|
||||||
|
|
||||||
Miniflux is a minimalist and web-based RSS reader.
|
Miniflux is a minimalist and web-based RSS reader.
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ function migrate_user(PDO $dst, array $user, array $settings)
|
|||||||
language
|
language
|
||||||
) VALUES (?, ?, ?, ?) RETURNING id');
|
) VALUES (?, ?, ?, ?) RETURNING id');
|
||||||
$rq->execute(array(
|
$rq->execute(array(
|
||||||
$user['username'],
|
strtolower($user['username']),
|
||||||
$user['password'],
|
$user['password'],
|
||||||
$user['is_admin'] == 1 ? 1 : 0,
|
$user['is_admin'] == 1 ? 1 : 0,
|
||||||
isset($settings['language']) && $settings['language'] == 'fr_FR' ? 'fr_FR' : 'en_US',
|
isset($settings['language']) && $settings['language'] == 'fr_FR' ? 'fr_FR' : 'en_US',
|
||||||
@ -76,9 +76,9 @@ function migrate_integrations(PDO $dst, $dst_user_id, array $user, array $settin
|
|||||||
isset($settings['wallabag_username']) ? $settings['wallabag_username'] : '',
|
isset($settings['wallabag_username']) ? $settings['wallabag_username'] : '',
|
||||||
isset($settings['wallabag_password']) ? $settings['wallabag_password'] : '',
|
isset($settings['wallabag_password']) ? $settings['wallabag_password'] : '',
|
||||||
1,
|
1,
|
||||||
$user['username'],
|
strtolower($user['username']),
|
||||||
isset($settings['fever_token']) ? $settings['fever_token'] : '',
|
isset($user['fever_token']) ? $user['fever_token'] : '',
|
||||||
isset($settings['fever_api_key']) ? $settings['fever_api_key'] : '',
|
isset($user['fever_api_key']) ? $user['fever_api_key'] : '',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,7 +214,7 @@ $srcDB = PicoDb\Database::getInstance('db')->getConnection();
|
|||||||
try {
|
try {
|
||||||
$dstDB->beginTransaction();
|
$dstDB->beginTransaction();
|
||||||
|
|
||||||
$rq = $srcDB->prepare('SELECT id, username, password, is_admin, fever_token FROM users');
|
$rq = $srcDB->prepare('SELECT id, username, password, is_admin, fever_token, fever_api_key FROM users');
|
||||||
$rq->execute();
|
$rq->execute();
|
||||||
$users = $rq->fetchAll(PDO::FETCH_ASSOC);
|
$users = $rq->fetchAll(PDO::FETCH_ASSOC);
|
||||||
echo '* '.count($users).' user(s) to migrate'.PHP_EOL;
|
echo '* '.count($users).' user(s) to migrate'.PHP_EOL;
|
||||||
|
Loading…
Reference in New Issue
Block a user