Skip to content

Commit c07f682

Browse files
xh3n1oliverklee
authored andcommitted
[TASK] Update DB Schema with the latest changes from phpList3 (#302)
1 parent e6bbcd7 commit c07f682

File tree

1 file changed

+32
-30
lines changed

1 file changed

+32
-30
lines changed

resources/Database/Schema.sql

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -71,25 +71,26 @@ CREATE TABLE `phplist_bounce` (
7171
`id` int(11) NOT NULL AUTO_INCREMENT,
7272
`date` datetime DEFAULT NULL,
7373
`header` text,
74-
`data` blob,
74+
`data` mediumblob,
7575
`status` varchar(255) DEFAULT NULL,
7676
`comment` text,
7777
PRIMARY KEY (`id`),
7878
KEY `dateindex` (`date`)
7979
) ENGINE=InnoDB AUTO_INCREMENT=2168 DEFAULT CHARSET=utf8;
8080

81-
DROP TABLE IF EXISTS `phplist_bounceregex`;
82-
CREATE TABLE `phplist_bounceregex` (
83-
`id` int(11) NOT NULL AUTO_INCREMENT,
84-
`regex` varchar(255) DEFAULT NULL,
85-
`action` varchar(255) DEFAULT NULL,
86-
`listorder` int(11) DEFAULT '0',
87-
`admin` int(11) DEFAULT NULL,
88-
`comment` text,
89-
`status` varchar(255) DEFAULT NULL,
90-
`count` int(11) DEFAULT '0',
91-
PRIMARY KEY (`id`),
92-
UNIQUE KEY `regex` (`regex`)
81+
DROP TABLE IF EXISTS phplist_bounceregex;
82+
CREATE TABLE phplist_bounceregex (
83+
id int(11) NOT NULL AUTO_INCREMENT,
84+
regex varchar(2083) DEFAULT NULL,
85+
regexhash char(32) DEFAULT NULL,
86+
action varchar(255) DEFAULT NULL,
87+
listorder int(11) DEFAULT '0',
88+
admin int(11) DEFAULT NULL,
89+
comment text,
90+
status varchar(255) DEFAULT NULL,
91+
count int(11) DEFAULT '0',
92+
PRIMARY KEY (id),
93+
UNIQUE KEY regex (regexhash)
9394
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
9495

9596
DROP TABLE IF EXISTS `phplist_bounceregex_bounce`;
@@ -152,14 +153,15 @@ CREATE TABLE `phplist_linktrack` (
152153
KEY `miduidindex` (`messageid`,`userid`)
153154
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
154155

155-
DROP TABLE IF EXISTS `phplist_linktrack_forward`;
156-
CREATE TABLE `phplist_linktrack_forward` (
157-
`id` int(11) NOT NULL AUTO_INCREMENT,
158-
`url` varchar(255) DEFAULT NULL,
159-
`personalise` tinyint(4) DEFAULT '0',
160-
PRIMARY KEY (`id`),
161-
UNIQUE KEY `urlunique` (`url`),
162-
KEY `urlindex` (`url`)
156+
DROP TABLE IF EXISTS phplist_linktrack_forward;
157+
CREATE TABLE phplist_linktrack_forward (
158+
id int(11) NOT NULL AUTO_INCREMENT,
159+
url varchar(2083) DEFAULT NULL,
160+
urlhash char(32) DEFAULT NULL,
161+
personalise tinyint(4) DEFAULT '0',
162+
PRIMARY KEY (id),
163+
UNIQUE KEY urlunique (urlhash),
164+
KEY urlindex (url(255))
163165
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
164166

165167
DROP TABLE IF EXISTS `phplist_linktrack_ml`;
@@ -413,15 +415,15 @@ CREATE TABLE `phplist_translation` (
413415
KEY `lanidx` (`lan`)
414416
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
415417

416-
DROP TABLE IF EXISTS `phplist_urlcache`;
417-
CREATE TABLE `phplist_urlcache` (
418-
`id` int(11) NOT NULL AUTO_INCREMENT,
419-
`url` varchar(255) NOT NULL,
420-
`lastmodified` int(11) DEFAULT NULL,
421-
`added` datetime DEFAULT NULL,
422-
`content` mediumtext,
423-
PRIMARY KEY (`id`),
424-
KEY `urlindex` (`url`)
418+
DROP TABLE IF EXISTS phplist_urlcache;
419+
CREATE TABLE phplist_urlcache (
420+
id int(11) NOT NULL AUTO_INCREMENT,
421+
url varchar(2083) NOT NULL,
422+
lastmodified int(11) DEFAULT NULL,
423+
added datetime DEFAULT NULL,
424+
content mediumtext,
425+
PRIMARY KEY (id),
426+
KEY urlindex (url(255))
425427
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
426428

427429
DROP TABLE IF EXISTS `phplist_user_attribute`;

0 commit comments

Comments
 (0)