summaryrefslogtreecommitdiffstats
path: root/apps/bookmarks
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-03-20 20:19:21 +0000
committerTom Needham <needham.thomas@gmail.com>2012-03-20 20:19:21 +0000
commit514c9ad8e7df1d7882adc33c42eb32a209537273 (patch)
treef39dae7822c3b7ddf678861a41a0ceea93e267f2 /apps/bookmarks
parent145d6f35660669397eaee08988ffbad1b65daff0 (diff)
downloadnextcloud-server-514c9ad8e7df1d7882adc33c42eb32a209537273.tar.gz
nextcloud-server-514c9ad8e7df1d7882adc33c42eb32a209537273.zip
Added unified import method.
Diffstat (limited to 'apps/bookmarks')
-rw-r--r--apps/bookmarks/lib/migrate.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/bookmarks/lib/migrate.php b/apps/bookmarks/lib/migrate.php
index 36a08c0cf40..02c96e59632 100644
--- a/apps/bookmarks/lib/migrate.php
+++ b/apps/bookmarks/lib/migrate.php
@@ -36,19 +36,19 @@ class OC_Migration_Provider_Bookmarks extends OC_Migration_Provider{
switch( $this->appinfo->version ){
default:
// 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 ?" );
- $results = $query->execute( array( $this->info['olduid'] ) );
+ $query = $this->content->prepare( "SELECT * FROM bookmarks WHERE user_id LIKE ?" );
+ $results = $query->execute( array( $this->olduid ) );
$idmap = array();
- while( $row = $data->fetchRow() ){
+ while( $row = $results->fetchRow() ){
// 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->execute( array( $row['url'], $row['title'], $this->info['newuid'], $row['public'], $row['added'], $row['lastmodified'] ) );
+ $query->execute( array( $row['url'], $row['title'], $this->uid, $row['public'], $row['added'], $row['lastmodified'] ) );
// Map the id
$idmap[$row['id']] = OC_DB::insertid();
}
// Now tags
foreach($idmap as $oldid => $newid){
- $query = OC_Migrate::prepare( "SELECT * FROM bookmarks_tags WHERE user_id LIKE ?" );
+ $query = $this->content->prepare( "SELECT * FROM bookmarks_tags WHERE user_id LIKE ?" );
$results = $query->execute( array( $oldid ) );
while( $row = $data->fetchRow() ){
// Import the tags for this bookmark, using the new bookmark id