Commit graph

198 commits

Author SHA1 Message Date
Habeas Codice
547d852ef7 fix update 1131 for postgres databases 2015-01-18 18:33:32 -08:00
friendica
1c9299ed42 more backend work on poco rating 2015-01-15 14:05:18 -08:00
Habeas Codice
28a0209ffd fix driver issue for large dbs
add rudimentary resume
2014-11-20 12:41:48 -08:00
Habeas Codice
9443ef8a3d simple command-line migrator from mysql to postgres
provided with the WorksForMe(tm) warranty of fitness for a purpose implied or otherwise
2014-11-17 12:26:24 -08:00
Habeas Codice
ac27db22c1 Merge remote-tracking branch 'upstream/master'
Conflicts:
	boot.php
	include/dba/dba_driver.php
	include/diaspora.php
	include/follow.php
	include/session.php
	include/zot.php
	mod/photos.php
	mod/ping.php
2014-11-13 13:06:31 -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
3b74e3c1e1 add defaults to database tables 2014-11-09 19:24:14 -08:00
friendica
d5d6158973 ok heads up - potentially destabilising change. I've tried to sort out all the default connection permissions for those who don't have a predefined (or therefore have a "custom") permissions role. Unfortunately this includes most people that were using this software more than a month ago. The real changes are that the SELF address book entry no longer holds "auto-permissions" but instead holds your "default permissions" (if you have a pre-defined role, the defaults will be pulled from the role table).
The auto permissions have moved to a pconfig (uid.system.autoperms). A DB update will move these settings into their new homes.

What used to be the "Auto-permissions settings" page is now the "default permissions settings" page and a checkbox therein decides whether or not to apply the permissions automatically. A link to this page will only be shown when you have the "custom" role selected.

With luck nobody will notice anything wrong. But at least for the next few days, please review permissions that have been assigned to new connections (either automatically or manually) and make sure they make sense (e.g. they aren't "nothing"). You still need to take action when seeing a message "permissions have changed but not yet submitted" as we always let you review and perhaps adjust the settings _before_ a connection is established (unless you have autoperms turned on).
2014-11-04 17:11:02 -08:00
Thomas Willingham
77fb1c2ee6 Doco - some clean up to install - keep politics out of it, 80 columnise it and
whitespace.
2014-10-22 20:22:37 +01:00
zottel
4fe8630518 document store writability requirements 2014-10-22 13:09:56 +02:00
friendica
5362943330 missing quote 2014-10-14 18:05:32 -07:00
friendica
2db7d88e28 this is the reason Diaspora forum tagging was broken 2014-10-14 18:02:34 -07:00
friendica
5236516145 install doc double escapes the store/[data] path. 2014-10-06 15:01:55 -07:00
jeroenpraat
0049f4c71a +png support
https://redmatrix.nl/channel/jeroenpraat/?f=&mid=83603d8f0876c040efafce87755fcd252dbe8da4a75d82fdb230519e3c8dcb72@redmatrix.nl
2014-10-05 21:05:50 +02:00
friendica
e8ef515b61 store diaspora meta info in the item table. It has to go there or it will kill us with complex joins. We can phase out the sign table once this all checks out. 2014-09-03 05:09:43 -07:00
Jeroen
3e8f9e8b62 update nl + Friendica>RedMatrix in two text files 2014-08-30 14:07:38 +00:00
friendica
53b5cf7f50 Ability to close comments at a certain date/time - needed for loom.io emulation (and many other uses) 2014-08-28 16:56:13 -07:00
friendica
eb27bea794 mind numbing drudgery continued... 2014-08-27 19:15:34 -07:00
friendica
e179dca446 place to store multiple choice and select items for extensible profiles 2014-08-26 22:37:04 -07:00
friendica
8c6067b411 more hard work 2014-08-26 20:51:59 -07:00
friendica
9196c9eef0 We really can't do this without a hubloc. I was hoping we could, but notifier is setup to take hublocs, not xchans. 2014-08-22 21:37:08 -07:00
friendica
4a76925787 some more work on realms 2014-08-17 19:06:56 -07:00
friendica
20bdcb037f provide backend storage and declaration of directory realm 2014-08-16 16:10:35 -07:00
friendica
7044975520 item table upgrade for storing post visibility 2014-08-06 17:00:25 -07:00
friendica
85032a1fa3 db tables for extensible profile fields 2014-08-02 14:56:17 -07:00
friendica
35ed18967a block channel removal for 48 hours after changing the account password, since the password is required to remove a channel. Somebody looking at an open session on somebody else's computer can simply change the password and then proceed to maliciously remove the channel. This change gives the owner 2 days to discover that something is wrong and recover his/her password and potentially save their channel from getting erased by the vandal. This is most likely to happen if a relationship has gone bad, or something incriminating was found in your private messages when you left your computer briefly unattended. 2014-07-29 20:13:01 -07:00
friendica
b19176169c provide a specific permission for liking profiles (reuse the obsolete bookmark permission), also remove the unused 'unconnected contacts' view for now. 2014-07-17 20:54:30 -07:00
friendica
3a31ddea2b provide os_mkdir to workaround permission issues with php mkdir 2014-07-16 01:07:00 -07:00
friendica
c74fd78993 move smarty compiled files to store/[data]/smarty3 - which puts all writeable areas of the server except the config file and logs under the "store" directory. We'll do logs at a future time. 2014-07-10 21:34:52 -07:00
friendica
fa706c8e86 finish implementing email verification. Currently it only applies if REGISTER_OPEN is in effect. 2014-07-09 21:10:56 -07:00
friendica
0cfcb02311 ability to like things 2014-06-23 05:19:28 -07:00
friendica
1dacfb375e honour the admin censored flag in the directory, and some slow progress on extended likes 2014-06-22 17:15:42 -07:00
friendica
a0747799fc likes table for liking things besides posts and comments 2014-06-22 03:39:43 -07:00
friendica
3821efb99e issue #477 2014-06-01 01:30:34 -07:00
friendica
bcac633085 implement 'requires' on personal apps 2014-05-22 19:19:04 -07:00
friendica
696f62331d try to recover from bad update 2014-05-20 22:38:33 -07:00
friendica
6d01707a72 more app backend work 2014-05-19 16:49:11 -07:00
friendica
68ca4ef19e support commerical apps 2014-05-18 02:21:06 -07:00
friendica
28e8a1d2d3 app DB structure 2014-05-17 17:18:56 -07:00
friendica
c93353c0a3 we seem to have lost any install text mentioning that subdirs and alternate ports aren't supported 2014-04-12 03:31:55 -07:00
Thomas Willingham
742e2686ca Don't explicitly deny our strongest features existence. 2014-04-11 14:53:18 +01:00
sasiflo
f16fc1eb4f Added some more details about why browser-valid SSL certificates must be
used when SSL is used at all.

It is now in the check failure message in the installation routine, the
installation readme and in the documentation pages.
2014-04-10 23:41:18 +02:00
friendica
ad60e2c566 use parent_mid in the parent query for enotify instead of of the parent id. This should fix the issue with encrypted content in the notification messages (for locally posted replies). The fix was a bit harder than anticipated because we store the parent id as an int in the notify table so this had to be modified to char storage as well. 2014-04-06 02:57:33 -07:00
friendica
27fec9cb64 more efficient public feed fetching 2014-04-02 15:13:50 -07:00
friendica
ced6d82633 finish up the source route storage so we can prevent messages from flowing upstream in complicated delivery chains 2014-03-31 16:25:05 -07:00
friendica
7375e30506 This should be a slight improvement in setting ciphers - we'll punt on RedHat but open up the list just for openssl distros which seem to have all the problems at the moment. 2014-03-25 15:19:18 -07:00
Thomas Willingham
fea711ecde Typo in database.sql 2014-03-07 17:27:44 +00:00
friendica
2a1729e671 typo 2014-03-06 01:34:39 -08:00
friendica
8c7e076dae bring friends back 2014-03-06 01:29:42 -08:00
friendica
3d49bf0320 directory sync issues 2014-03-03 21:00:42 -08:00