Commit graph

52 commits

Author SHA1 Message Date
friendica
a496036066 local_user => local_channel 2015-01-28 20:56:04 -08:00
Habeas Codice
1a5a5c7edb PostgreSQL support initial commit
There were 11 main types of changes:
- UPDATE's and DELETE's sometimes had LIMIT 1 at the end of them. This is not only non-compliant but
it would certainly not do what whoever wrote it thought it would. It is likely this mistake was just
copied from Friendica. All of these instances, the LIMIT 1 was simply removed.
- Bitwise operations (and even some non-zero int checks) erroneously rely on MySQL implicit
integer-boolean conversion in the WHERE clauses. This is non-compliant (and bad programming practice
to boot). Proper explicit boolean conversions were added. New queries should use proper conventions.
- MySQL has a different operator for bitwise XOR than postgres. Rather than add yet another dba_
func, I converted them to "& ~" ("AND NOT") when turning off, and "|" ("OR") when turning on. There
were no true toggles (XOR). New queries should refrain from using XOR when not necessary.
- There are several fields which the schema has marked as NOT NULL, but the inserts don't specify
them. The reason this works is because mysql totally ignores the constraint and adds an empty text
default automatically. Again, non-compliant, obviously. In these cases a default of empty text was
added.
- Several statements rely on a non-standard MySQL feature
(http://dev.mysql.com/doc/refman/5.5/en/group-by-handling.html). These queries can all be rewritten
to be standards compliant. Interestingly enough, the newly rewritten standards compliant queries run
a zillion times faster, even on MySQL.
- A couple of function/operator name translations were needed (RAND/RANDOM, GROUP_CONCAT/STRING_AGG,
UTC_NOW, REGEXP/~, ^/#) -- assist functions added in the dba_
- INTERVALs: postgres requires quotes around the value, mysql requires that there are not quotes
around the value -- assist functions added in the dba_
- NULL_DATE's -- Postgres does not allow the invalid date '0000-00-00 00:00:00' (there is no such
thing as year 0 or month 0 or day 0). We use '0001-01-01 00:00:00' for postgres. Conversions are
handled in Zot/item packets automagically by quoting all dates with dbescdate().
- char(##) specifications in the schema creates fields with blank spaces that aren't trimmed in the
code. MySQL apparently treats char(##) as varchar(##), again, non-compliant. Since postgres works
better with text fields anyway, this ball of bugs was simply side-stepped by using 'text' datatype
for all text fields in the postgres schema. varchar was used in a couple of places where it actually
seemed appropriate (size constraint), but without rigorously vetting that all of the PHP code
actually validates data, new bugs might come out from under the rug.
- postgres doesn't store nul bytes and a few other non-printables in text fields, even when quoted.
bytea fields were used when storing binary data (photo.data, attach.data). A new dbescbin() function
was added to handle this transparently.
- postgres does not support LIMIT #,# syntax. All databases support LIMIT # OFFSET # syntax.
Statements were updated to be standard.

These changes require corresponding changes in the coding standards. Please review those before
adding any code going forward.

Still on my TODO list:
- remove quotes from non-reserved identifiers and make reserved identifiers use dba func for quoting
- Rewrite search queries for better results (both MySQL and Postgres)
2014-11-13 12:21:58 -08:00
friendica
d93f7d688d fix group membership management for non-red connections 2014-09-03 18:24:42 -07:00
friendica
98e85917bb subdue archived connections in group editor and don't show at all in contact_block() 2014-07-16 22:21:29 -07:00
friendica
fc7e782ba5 sql error 2014-06-25 20:32:24 -07:00
marijus
f62ec4132e let oneself be added to a collection in exchange for deleted contacts 2014-02-07 21:28:39 +01:00
friendica
1a42580ad4 remove a couple of mysql reserved words from being used as table or row names. For this round we're getting 'group' and 'desc'. Warning: potentially destabilising as this touches a lot of code. 2013-12-22 18:37:39 -08:00
friendica
2c0fbc508e comanchify connedit, group 2013-12-19 23:56:37 -08:00
zottel
0e9df93a69 Make it possible to change visibility without changing name. 2013-12-05 13:44:31 +01:00
friendica
4cda133e89 Add public visibility setting to privacy groups (collections). This doesn't yet make them visible, but allows them to be visible (like a Cc: instead of a Bcc:) 2013-08-07 17:51:10 -07:00
friendica
b33c15d045 members_of_group() output not entirely correct 2013-05-02 20:51:58 -07:00
Michael Johnston
2fb44aa31b change collections to connections 2013-02-17 14:33:34 -05:00
Oliver
a37cd2f600 fix con"n"nections 2013-02-02 20:03:01 +01:00
friendica
01be0fc2d8 fix the visual group editor 2013-01-20 20:58:06 -08:00
friendica
8eee37e1fa more logging, some debugging of group membership page 2012-12-30 15:28:13 -08:00
friendica
f7ff2de132 add pending check on group queries 2012-11-29 23:06:03 -08:00
friendica
5fee78b215 cleanup 2012-11-14 21:27:05 -08:00
friendica
160258fd5d make the visual group editor work again in the new world 2012-11-14 20:55:05 -08:00
friendica
2fa93655c4 a lot more changes of terminology 2012-11-03 02:34:12 -07:00
friendica
e29618ee0d contact group is now 'channel group' 2012-10-27 03:54:44 -07:00
friendica
a20a637727 merge upstream, slider work, refactor ping module, language selection work 2012-07-13 07:09:29 -07:00
Alexander Kampmann
355c42cb30 Merge branch 'master' of https://github.com/friendica/friendica
Conflicts:
	include/config.php
	update.php
2012-04-05 13:39:15 +02:00
Tobias Hößl
453b5b46a3 CSRF-Protection in the group-related form (creating, renaming and dropping a group, adding/removing members from it) 2012-03-18 15:44:33 +00:00
Fabio Comuni
5fc3c3ab85 group: fix create new group form 2012-03-02 15:40:17 +01:00
Fabio Comuni
fd3274ff53 less html in mod/group.php, template for group members editor, quattro theme for group edit. 2012-02-23 16:17:36 +01:00
friendica
f03aaf554e mark all notifications read 2012-02-21 16:59:57 -08:00
friendica
8aa2552372 add remove_user hook (it looks like dreamhost changed all my file permissions, this will make a nasty commit) 2012-01-18 16:21:30 -08:00
Devlon Duthie
bbaec4cb78 moved contact group header out of scrolling div so it doens't vanish whenlot
more css tweaks
2011-09-25 14:08:08 -05:00
Friendika
f53a2d6da9 add group highlight to other pages 2011-07-01 06:23:09 -07:00
Friendika
58d474aa2d switch to text mode group editor after 'n' contacts 2011-06-29 20:42:16 -07:00
Fabio Comuni
e1107b55c6 add info() function. Works like notice() but show messages in a div with class info-message.
update code to use info() instead of notice() when appropriate (non-error message)
add info-message class style in themes
2011-05-23 11:39:57 +02:00
Friendika
730322ee5f bug #70 - error messages on group deletion, warning cleanup 2011-05-15 16:36:49 -07:00
Friendika
b2e92e0af3 deprecate load_view_file 2011-05-11 04:37:13 -07:00
Friendika
c052d68828 don't use load_view_file() except in email templates and install of htconfig - to avoid getting wrong file when package is updated by copying over an older version. 2011-05-10 16:12:50 -07:00
Friendika
5545c8ada9 cleanup 2011-04-12 05:37:26 -07:00
Friendika
61915a524d first cut at group chooser UI 2011-04-12 01:31:55 -07:00
Friendika
6da84027af visual display of group members 2011-04-11 22:47:16 -07:00
Friendika
c32ed16303 more templates converted to string files 2011-04-06 22:42:08 -07:00
Friendika
de5495f90b don't process empty or non-existent group array 2011-01-02 21:53:00 -08:00
Friendika
8c395f96de view directory cleanup 2010-11-15 21:02:59 -08:00
Mike Macgirvin
ac824fe83e eradicate redundant get_uid function 2010-10-18 14:34:59 -07:00
Mike Macgirvin
511c761fec group/community/celebrity pages 2010-10-18 00:43:49 -07:00
Mike Macgirvin
34eedb503a stronger type checking on comparisons 2010-09-26 17:24:20 -07:00
Mike Macgirvin
d5a13b1e4c localisation path for all view templates 2010-09-22 18:00:19 -07:00
Mike Macgirvin
ffb1997902 mistpark 2.0 infrasturcture lands 2010-09-08 20:14:17 -07:00
Mike Macgirvin
d2c6fa3fa1 group removal 2010-08-11 04:14:47 -07:00
Mike Macgirvin
f4e634ad52 group drop 2010-08-11 01:48:43 -07:00
Mike Macgirvin
e4325bc565 . 2010-07-13 04:18:57 -07:00
Mike Macgirvin
c3273dfcdc group editor cleanup 2010-07-13 04:05:23 -07:00
Mike Macgirvin
323697d9dc more group editor 2010-07-13 02:26:28 -07:00