Skip to content

Commit

Permalink
authpdo: fix mybb schema for MySQL 5.7+
Browse files Browse the repository at this point in the history
https://dev.mysql.com/doc/refman/5.7/en/upgrading-from-previous-series.html

> In MySQL 5.7.5, these SQL mode changes were made: ... Strict SQL mode for transactional storage engines (`STRICT_TRANS_TABLES`) is now enabled by default.

https://dev.mysql.com/doc/refman/5.7/en/data-type-defaults.html

> For data entry into a NOT NULL column that has no explicit DEFAULT clause, if an INSERT or REPLACE statement includes no value for the column, or an UPDATE statement sets the column to NULL, MySQL handles the column according to the SQL mode in effect at the time:
>
> If strict SQL mode is enabled, an error occurs for transactional tables and the statement is rolled back. For nontransactional tables, an error occurs, but if this happens for the second or subsequent row of a multiple-row statement, the preceding rows will have been inserted.
  • Loading branch information
phy25 committed Sep 9, 2019
1 parent 6a1b9bf commit c8f8620
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/plugins/authpdo/_test/mysql/mybb.sql
Expand Up @@ -30,13 +30,13 @@ CREATE TABLE `mybb_usergroups` (
`gid` smallint(5) unsigned NOT NULL,
`type` tinyint(1) unsigned NOT NULL DEFAULT '2',
`title` varchar(120) NOT NULL DEFAULT '',
`description` text NOT NULL,
`description` text NOT NULL DEFAULT '',
`namestyle` varchar(200) NOT NULL DEFAULT '{username}',
`usertitle` varchar(120) NOT NULL DEFAULT '',
`stars` smallint(4) unsigned NOT NULL DEFAULT '0',
`starimage` varchar(120) NOT NULL DEFAULT '',
`image` varchar(120) NOT NULL DEFAULT '',
`disporder` smallint(6) unsigned NOT NULL,
`disporder` smallint(6) unsigned NOT NULL DEFAULT '0',
`isbannedgroup` tinyint(1) NOT NULL DEFAULT '0',
`canview` tinyint(1) NOT NULL DEFAULT '0',
`canviewthreads` tinyint(1) NOT NULL DEFAULT '0',
Expand Down Expand Up @@ -209,7 +209,7 @@ CREATE TABLE `mybb_users` (
`google` varchar(75) NOT NULL DEFAULT '',
`birthday` varchar(15) NOT NULL DEFAULT '',
`birthdayprivacy` varchar(4) NOT NULL DEFAULT 'all',
`signature` text NOT NULL,
`signature` text NOT NULL DEFAULT '',
`allownotices` tinyint(1) NOT NULL DEFAULT '0',
`hideemail` tinyint(1) NOT NULL DEFAULT '0',
`subscriptionmethod` tinyint(1) NOT NULL DEFAULT '0',
Expand All @@ -235,15 +235,15 @@ CREATE TABLE `mybb_users` (
`timezone` varchar(5) NOT NULL DEFAULT '',
`dst` tinyint(1) NOT NULL DEFAULT '0',
`dstcorrection` tinyint(1) NOT NULL DEFAULT '0',
`buddylist` text NOT NULL,
`ignorelist` text NOT NULL,
`buddylist` text NOT NULL DEFAULT '',
`ignorelist` text NOT NULL DEFAULT '',
`style` smallint(5) unsigned NOT NULL DEFAULT '0',
`away` tinyint(1) NOT NULL DEFAULT '0',
`awaydate` int(10) unsigned NOT NULL DEFAULT '0',
`returndate` varchar(15) NOT NULL DEFAULT '',
`awayreason` varchar(200) NOT NULL DEFAULT '',
`pmfolders` text NOT NULL,
`notepad` text NOT NULL,
`pmfolders` text NOT NULL DEFAULT '',
`notepad` text NOT NULL DEFAULT '',
`referrer` int(10) unsigned NOT NULL DEFAULT '0',
`referrals` int(10) unsigned NOT NULL DEFAULT '0',
`reputation` int(11) NOT NULL DEFAULT '0',
Expand All @@ -264,7 +264,7 @@ CREATE TABLE `mybb_users` (
`coppauser` tinyint(1) NOT NULL DEFAULT '0',
`classicpostbit` tinyint(1) NOT NULL DEFAULT '0',
`loginattempts` smallint(2) unsigned NOT NULL DEFAULT '1',
`usernotes` text NOT NULL,
`usernotes` text NOT NULL DEFAULT '',
`sourceeditor` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=MyISAM AUTO_INCREMENT=88 DEFAULT CHARSET=utf8;

Expand Down

0 comments on commit c8f8620

Please sign in to comment.