Commit Graph

15 Commits

Author SHA1 Message Date
Alexei Sorokin
665e4574da [DATABASE] Fix index identifiers and clean up redundant ones 2021-07-16 19:44:38 +01:00
Alexei Sorokin
26115482ef [SCHEMA] Improve timestamp storage
Avoid the use of deprecated MariaDB "zero dates" globally. If they're present
as attribute defaults somewhere, they will be replaced with NULL implicitly.
The existing "zero dates" in MariaDB storage will be left intact and this
should not present any issues.

The "timestamp" type in table definitions now corresponds to DATETIME in
MariaDB with "DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP", which
should be close enough to the original behaviour for compatibility purposes.
It is now the recommended type for "modified" attributes, because of the
update trigger on MariaDB. But there is no such trigger implemented on
PostgreSQL as of this moment.
2021-07-16 19:44:37 +01:00
Alexei Sorokin
16b5ddd230 [DATABASE] Re-introduce PostgreSQL support 2021-07-16 19:44:35 +01:00
Diogo Cordeiro
f67a93eddc [CORE] Bump Database requirement to MariaDB 10.3+ 2019-08-03 17:47:23 +01:00
Chimo
90945e548b Profile_prefs::getAll fix prefs loop
DataObject::fetch doesn't return an object.
2015-12-17 14:58:06 +00:00
Chimo
71119e4980 Profile_prefs::getAll fix call to listFind
2nd argument needs to be an array
2015-12-17 14:55:39 +00:00
Mikael Nordfeldth
f9698598c6 Modernize Profile_prefs to use Managed_DataObject functions 2015-06-04 22:26:31 +02:00
Mikael Nordfeldth
2f86cd8602 utf8mb4 conversion on database with index adjusts 2015-02-12 18:18:55 +01:00
Mikael Nordfeldth
b46b588522 New Profile_prefs get a 'created' value now. 2014-07-13 17:09:18 +02:00
Mikael Nordfeldth
b67a611ca7 Allow default data from Profile_prefs::getData call 2014-07-13 16:26:08 +02:00
Mikael Nordfeldth
d289ccb7f2 Minor PHP stylistic features and typing stuff 2013-11-02 13:05:08 +01:00
Mikael Nordfeldth
f46d675a20 GNU social is with a minor s. 2013-10-15 00:20:36 +02:00
Mikael Nordfeldth
3000adb33d pkeyGet unfortunately returns null (should throw NoResultException) on empty result 2013-10-06 20:04:09 +02:00
Mikael Nordfeldth
2770ef9718 listFind throws NoResultException on no results 2013-10-06 16:37:51 +02:00
Mikael Nordfeldth
c3d46b81a8 Added Profile_prefs class for profile preferences
Profile_prefs aims to consolidate all the profile preferences into a
single table. Otherwise we end up with a bajillion *_prefs classes, like
User_urlshortener_prefs, or new fields in existing User/Profile classes,
like 'urlshorteningservice', 'homepage', 'phone_number', 'pet_name' etc.

Eventually we should migrate as many user-settable preferences as we can
into this system.

The data in Profile_prefs is organized by:
    * profile_id    Identify the current Profile.
    * namespace     Which plugin/section the preference is for.
    * topic         Preference name (like 'homepage')
    * data          Preference data (like 'https://gnu.org/')

The names 'topic' and 'data' are because 'key' and 'value' may be rather
ambigous when dealing with our DB_DataObject classes etc.
2013-10-06 14:07:00 +02:00