aboutsummaryrefslogtreecommitdiffstats
path: root/install/database.sql
Commit message (Collapse)AuthorAgeFilesLines
* PostgreSQL support initial commitHabeas Codice2014-11-131-1228/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* store diaspora meta info in the item table. It has to go there or it will ↵friendica2014-09-031-0/+1
| | | | kill us with complex joins. We can phase out the sign table once this all checks out.
* Ability to close comments at a certain date/time - needed for loom.io ↵friendica2014-08-281-0/+3
| | | | emulation (and many other uses)
* mind numbing drudgery continued...friendica2014-08-271-0/+2
|
* place to store multiple choice and select items for extensible profilesfriendica2014-08-261-0/+1
|
* more hard workfriendica2014-08-261-0/+26
|
* We really can't do this without a hubloc. I was hoping we could, but ↵friendica2014-08-221-0/+2
| | | | notifier is setup to take hublocs, not xchans.
* provide backend storage and declaration of directory realmfriendica2014-08-161-1/+3
|
* item table upgrade for storing post visibilityfriendica2014-08-061-0/+2
|
* db tables for extensible profile fieldsfriendica2014-08-021-0/+22
|
* block channel removal for 48 hours after changing the account password, ↵friendica2014-07-291-1/+3
| | | | 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.
* provide a specific permission for liking profiles (reuse the obsolete ↵friendica2014-07-171-2/+2
| | | | bookmark permission), also remove the unused 'unconnected contacts' view for now.
* ability to like thingsfriendica2014-06-231-1/+3
|
* honour the admin censored flag in the directory, and some slow progress on ↵friendica2014-06-221-1/+3
| | | | extended likes
* likes table for liking things besides posts and commentsfriendica2014-06-221-0/+16
|
* implement 'requires' on personal appsfriendica2014-05-221-0/+1
|
* more app backend workfriendica2014-05-191-1/+1
|
* support commerical appsfriendica2014-05-181-1/+5
|
* app DB structurefriendica2014-05-171-0/+22
|
* use parent_mid in the parent query for enotify instead of of the parent id. ↵friendica2014-04-061-1/+1
| | | | 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.
* more efficient public feed fetchingfriendica2014-04-021-1/+2
|
* finish up the source route storage so we can prevent messages from flowing ↵friendica2014-03-311-11/+12
| | | | upstream in complicated delivery chains
* Typo in database.sqlThomas Willingham2014-03-071-1/+1
|
* put bookmarked chatrooms into pocofriendica2014-02-251-1/+3
|
* more chatroom discoveryfriendica2014-02-251-0/+11
|
* Also update database.sqlThomas Willingham2014-02-251-12/+12
|
* set default for account_level in DBfriendica2014-02-071-1/+1
|
* bookmark permissionsfriendica2014-02-041-0/+2
|
* chat expiration (default 2 hours) - but can be set on a per-chatroom basisfriendica2014-01-301-1/+3
|
* add client field to chatpresence - which will give us a place to put IP ↵friendica2014-01-281-0/+1
| | | | addresses for webRTC. Might as well allow for that since we'll (soon) have presence. Then we wouldn't need SIP and folks can "just" p2p each other using any mechanism they wish if they have permission to do so.
* chat data structuresfriendica2014-01-271-8/+52
|
* allow menus to have special rolesfriendica2014-01-151-1/+3
|
* only let visitors remove their own files.friendica2014-01-091-0/+2
|
* allow objects to have permissionsfriendica2013-12-281-0/+4
|
* db update for directory profiles - and fix broken database.sql from the ↵friendica2013-12-251-13/+18
| | | | sys_perms addition a couple days back
* add account_level, is_foreigner and is_member functions; convert all e2ee ↵friendica2013-12-231-1/+3
| | | | user input and prompts to hex to avoid javascipt's lame handling of quotes. !!This breaks all prior encrypted posts.!!
* remove a couple of mysql reserved words from being used as table or row ↵friendica2013-12-221-3/+3
| | | | names. For this round we're getting 'group' and 'desc'. Warning: potentially destabilising as this touches a lot of code.
* Ooops, also update the DBThomas Willingham2013-12-221-0/+8
|
* add aid to notifiy table which we may need to supress duplicate notify ↵friendica2013-11-201-1/+3
| | | | | | emails across your channels also try to handle the wretched mess of broken and duplicated hublocs that fred.cepheus.uberspace.de typically reports
* remove the challenge table as wellfriendica2013-11-181-10/+0
|
* drop the queue table which we no longer usefriendica2013-11-181-16/+0
|
* DB - allow private messages to expirefriendica2013-11-061-18/+19
|
* Fix missing parenthesis in database.sqlAntoine G2013-11-011-1/+1
| | | This was blocking database creation process
* allow zot public providers to list their location, as a non US-based server ↵friendica2013-10-301-0/+1
| | | | could be a strong selling point.
* Schema change - add channel_dirdate so we can ping a directory server once a ↵friendica2013-10-271-0/+2
| | | | month which means we can find dead channels - because they won't be pinging the directory server once a month.
* preserve the source owner when creating a delivery fork so that we can ↵friendica2013-10-131-0/+1
| | | | uplink back to them without any ambiguity.
* post signaturesfriendica2013-10-021-1/+1
|
* implement republish permission for use in sourced channelsfriendica2013-09-301-0/+2
|
* directory sync - this will either work, or it won't work, or it will ↵friendica2013-09-301-1/+4
| | | | | | | | | possibly recurse and blow up the matrix. Hard to say. Do you feel lucky? Well do ya' ... punk? Rule #1 - don't mess with anything unless it's blowing up the matrix. If it doesn't blow up the matrix, but doesn't work, just let it go and let's figure out what it is doing and what it isn't doing. The flow is as follows: Once a day go out to all the directory servers besides yourself and grab a list of updates. This happens in the poller. If we've never seen them before add them to the updates table. The poller also looks to see if we're a directory server and have updates that haven't yet been processed. It calls onedirsync.php to process each one. If we contact the channel to update and don't find anything (we're just doing a basic zot_finger), set a ud_last timestamp. If this is set we will only try once a day for seven days. Then we stop trying to update. This will probably cause a spike the first time through because you haven't seen any updates before, but we spread out the load over your delivery interval.
* structure for channel unionsfriendica2013-09-261-0/+12
|