friendica-github/doc/database
Alexandre Alapetite d2901dcb00 Fix for MySQL 5.7+
https://github.com/friendica/friendica/issues/2786

Only tested on Ubuntu 16.10 with MySQL 5.7.17.

https://dev.mysql.com/doc/refman/8.0/en/timestamp-initialization.html

https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html#sqlmode_no_zero_date
As of MySQL 5.7.4, NO_ZERO_DATE is deprecated.

Patch based on the following search & replace (and then reverting some
changes in libraries):

```sh
grep -l '= "0000-00-00"' -r . | xargs sed -i -e "s/= \"0000-00-00\"/=
'0000-00-00'/g"

grep -l "0000-00-00" -r . | xargs sed -i -e "s/0000-00-00/0001-01-01/g"

grep -l "!= '0001-01-01'" -r . | xargs sed -i -e "s/!= '0001-01-01'/>
'0001-01-01'/g"

grep -l " === '0001-01-01'" -r . | xargs sed -i -e "s/ === '0001-01-01'/
<= '0001-01-01'/g"

grep -l " == '0001-01-01'" -r . | xargs sed -i -e "s/ == '0001-01-01'/
<= '0001-01-01'/g"

grep -l "strpos(\$dob, '0000-') === 0" -r . | xargs sed -i -e
"s/strpos(\$dob, '0000-') === 0/strpos(\$dob, '0000-') === 0 ||
strpos(\$dob, '0001-') === 0/g"

grep -l 'array("", "0001-01-01")' -r . | xargs sed -i -e 's/array("",
"0001-01-01")/array("", "0000-00-00", "0001-01-01")/g'

grep -l "\$dob = '0000-'" -r . | xargs sed -i -e "s/\$dob =
'0000-'/\$dob = '0001-'/g"
```
2017-04-11 23:00:45 +02:00
..
db_addon.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_attach.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_auth_codes.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_cache.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_challenge.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_clients.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_config.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_contact.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_conv.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_deliverq.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_event.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_fcontact.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_ffinder.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_fserver.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_fsuggest.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_gcign.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_gcontact.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_glink.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_group.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_group_member.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_gserver.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_hook.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_intro.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_item.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_item_id.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_locks.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_mail.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_mailacct.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_manage.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_notify-threads.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_notify.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_oembed.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_parsed_url.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_pconfig.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_photo.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_poll.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_poll_result.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_profile.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_profile_check.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_push_subscriber.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_queue.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_register.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_search.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_session.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_sign.md Retraction do work as well 2016-03-17 12:24:23 +01:00
db_spam.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_term.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_thread.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_tokens.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_user.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00
db_userd.md docu - add schema of each db table 2015-12-28 02:50:25 +01:00
db_workerqueue.md Fix for MySQL 5.7+ 2017-04-11 23:00:45 +02:00