mirror of
https://github.com/owncloud/bookmarks.git
synced 2025-02-28 00:54:31 +01:00
Migration info is an object. Other fixes
This commit is contained in:
parent
372b699a00
commit
d382ec60eb
@ -34,16 +34,16 @@ class OC_Migrate_Provider_Bookmarks extends OC_Migrate_Provider{
|
|||||||
// Import function for bookmarks
|
// Import function for bookmarks
|
||||||
function import( $info ){
|
function import( $info ){
|
||||||
|
|
||||||
switch( $info['appversion'] ){
|
switch( $info->appversion ){
|
||||||
default:
|
default:
|
||||||
// All versions of the app have had the same db structure, so all can use the same import function
|
// All versions of the app have had the same db structure, so all can use the same import function
|
||||||
$query = OC_Migrate::prepare( "SELECT * FROM bookmarks WHERE user_id LIKE ?" );
|
$query = OC_Migrate::prepare( "SELECT * FROM bookmarks WHERE user_id LIKE ?" );
|
||||||
$results = $query->execute( array( $info['olduid'] ) );
|
$results = $query->execute( array( $info->olduid ) );
|
||||||
$idmap = array();
|
$idmap = array();
|
||||||
while( $row = $data->fetchRow() ){
|
while( $row = $data->fetchRow() ){
|
||||||
// Import each bookmark, saving its id into the map
|
// Import each bookmark, saving its id into the map
|
||||||
$query = OC_DB::prepare( "INSERT INTO *PREFIX*bookmarks(url, title, user_id, public, added, lastmodified) VALUES (?, ?, ?, ?, ?, ?)" );
|
$query = OC_DB::prepare( "INSERT INTO *PREFIX*bookmarks(url, title, user_id, public, added, lastmodified) VALUES (?, ?, ?, ?, ?, ?)" );
|
||||||
$query->execute( array( $row['url'], $row['title'], $info['newuid'], $row['public'], $row['added'], $row['lastmodified'] ) );
|
$query->execute( array( $row['url'], $row['title'], $info->newuid, $row['public'], $row['added'], $row['lastmodified'] ) );
|
||||||
// Map the id
|
// Map the id
|
||||||
$idmap[$row['id']] = OC_DB::insertid();
|
$idmap[$row['id']] = OC_DB::insertid();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user