aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBrice Maron <brice@bmaron.net>2011-10-29 11:40:48 +0200
committerBrice Maron <brice@bmaron.net>2011-10-29 11:40:48 +0200
commite533e82bc9526ef9869b20e99b745c210348218f (patch)
tree6ce0621f070c3888e1c34b68b7bf5ae0636add76 /apps
parent5ffec927012a98cdcc409318dd1b2a264f071b83 (diff)
downloadnextcloud-server-e533e82bc9526ef9869b20e99b745c210348218f.tar.gz
nextcloud-server-e533e82bc9526ef9869b20e99b745c210348218f.zip
Add sequence name in insertid to be more portable
Diffstat (limited to 'apps')
-rw-r--r--apps/bookmarks/ajax/addBookmark.php8
-rw-r--r--apps/calendar/lib/calendar.php4
-rw-r--r--apps/calendar/lib/object.php4
-rw-r--r--apps/contacts/lib/addressbook.php4
-rw-r--r--apps/contacts/lib/vcard.php4
-rw-r--r--apps/media/lib_collection.php2
6 files changed, 10 insertions, 16 deletions
diff --git a/apps/bookmarks/ajax/addBookmark.php b/apps/bookmarks/ajax/addBookmark.php
index 3975fd15f81..45b16ae5fa6 100644
--- a/apps/bookmarks/ajax/addBookmark.php
+++ b/apps/bookmarks/ajax/addBookmark.php
@@ -54,13 +54,7 @@ $params=array(
);
$query->execute($params);
-if($CONFIG_DBTYPE == 'pgsql')
-{
- $query = OC_DB::prepare("SELECT currval('*PREFIX*bookmarks_id_seq')");
- $b_id = $query->execute()->fetchOne();
-} else {
- $b_id = OC_DB::insertid();
-}
+$b_id = OC_DB::insertid('*PREFIX*bookmarks');
if($b_id !== false) {
diff --git a/apps/calendar/lib/calendar.php b/apps/calendar/lib/calendar.php
index c19c0e73c08..f6d40aa534e 100644
--- a/apps/calendar/lib/calendar.php
+++ b/apps/calendar/lib/calendar.php
@@ -111,7 +111,7 @@ class OC_Calendar_Calendar{
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' );
$result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components));
- return OC_DB::insertid();
+ return OC_DB::insertid('*PREFIX*calendar_calendar');
}
/**
@@ -131,7 +131,7 @@ class OC_Calendar_Calendar{
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' );
$result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components));
- return OC_DB::insertid();
+ return OC_DB::insertid('*PREFIX*calendar_calendars');
}
/**
diff --git a/apps/calendar/lib/object.php b/apps/calendar/lib/object.php
index 0c3e497d4f2..33871cd3185 100644
--- a/apps/calendar/lib/object.php
+++ b/apps/calendar/lib/object.php
@@ -78,7 +78,7 @@ class OC_Calendar_Object{
OC_Calendar_Calendar::touchCalendar($id);
- return OC_DB::insertid();
+ return OC_DB::insertid('*PREFIX*calendar_objects');
}
/**
@@ -97,7 +97,7 @@ class OC_Calendar_Object{
OC_Calendar_Calendar::touchCalendar($id);
- return OC_DB::insertid();
+ return OC_DB::insertid('*PREFIX*calendar_objects');
}
/**
diff --git a/apps/contacts/lib/addressbook.php b/apps/contacts/lib/addressbook.php
index 2e869d7de3b..87477ed7ed4 100644
--- a/apps/contacts/lib/addressbook.php
+++ b/apps/contacts/lib/addressbook.php
@@ -96,7 +96,7 @@ class OC_Contacts_Addressbook{
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_addressbooks (userid,displayname,uri,description,ctag) VALUES(?,?,?,?,?)' );
$result = $stmt->execute(array($userid,$name,$uri,$description,1));
- return OC_DB::insertid();
+ return OC_DB::insertid('*PREFIX*contacts_addressbooks');
}
/**
@@ -113,7 +113,7 @@ class OC_Contacts_Addressbook{
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_addressbooks (userid,displayname,uri,description,ctag) VALUES(?,?,?,?,?)' );
$result = $stmt->execute(array($userid,$name,$uri,$description,1));
- return OC_DB::insertid();
+ return OC_DB::insertid('*PREFIX*contacts_addressbooks');
}
/**
diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php
index 74bc0f92f1b..adfa32b6f5f 100644
--- a/apps/contacts/lib/vcard.php
+++ b/apps/contacts/lib/vcard.php
@@ -121,7 +121,7 @@ class OC_Contacts_VCard{
OC_Contacts_Addressbook::touch($id);
- return OC_DB::insertid();
+ return OC_DB::insertid('*PREFIX*contacts_cards');
}
/**
@@ -147,7 +147,7 @@ class OC_Contacts_VCard{
OC_Contacts_Addressbook::touch($id);
- return OC_DB::insertid();
+ return OC_DB::insertid('*PREFIX*contacts_cards');
}
/**
diff --git a/apps/media/lib_collection.php b/apps/media/lib_collection.php
index 571cb7e6850..caa3ac3f479 100644
--- a/apps/media/lib_collection.php
+++ b/apps/media/lib_collection.php
@@ -267,7 +267,7 @@ class OC_MEDIA_COLLECTION{
$query=self::$queries['addsong'];
}
$query->execute(array($name,$artist,$album,$path,$uid,$length,$track,$size));
- $songId=OC_DB::insertid();
+ $songId=OC_DB::insertid('*PREFIX*media_songs');
// self::setLastUpdated();
return self::getSongId($name,$artist,$album);
}