aboutsummaryrefslogtreecommitdiff
path: root/app/SQL/install.sql.mysql.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-10-30 21:10:09 +0100
committerGravatar GitHub <noreply@github.com> 2023-10-30 21:10:09 +0100
commit21a279179a5e496082f4e43c5a2a5e10d90c0bdb (patch)
treee4cf86f096eba2b2f4b65d53203d06533979d5f4 /app/SQL/install.sql.mysql.php
parentf72a5a43b3a85cc1b4596ed6eb447ac17395eca7 (diff)
Ready for year 2038 (#5570)
* Ready for year 2038 Fix https://github.com/FreshRSS/FreshRSS/discussions/5569 Requires PHP on a 64-bit platform to take advantage of it. https://en.wikipedia.org/wiki/Year_2038_problem * Allows dates past 2038 Rework of https://github.com/FreshRSS/FreshRSS/pull/3259 https://github.com/FreshRSS/FreshRSS/issues/3258 * Auto alter columns * Changelog
Diffstat (limited to 'app/SQL/install.sql.mysql.php')
-rw-r--r--app/SQL/install.sql.mysql.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/app/SQL/install.sql.mysql.php b/app/SQL/install.sql.mysql.php
index cb12fa179..b79450943 100644
--- a/app/SQL/install.sql.mysql.php
+++ b/app/SQL/install.sql.mysql.php
@@ -24,7 +24,7 @@ CREATE TABLE IF NOT EXISTS `_feed` (
`name` VARCHAR(191) NOT NULL,
`website` TEXT CHARACTER SET latin1 COLLATE latin1_bin,
`description` TEXT,
- `lastUpdate` INT(11) DEFAULT 0, -- Until year 2038
+ `lastUpdate` BIGINT DEFAULT 0,
`priority` TINYINT(2) NOT NULL DEFAULT 10,
`pathEntries` VARCHAR(65535) DEFAULT NULL,
`httpAuth` VARCHAR(1024) DEFAULT NULL,
@@ -47,8 +47,8 @@ CREATE TABLE IF NOT EXISTS `_entry` (
`author` VARCHAR(65535),
`content_bin` MEDIUMBLOB, -- v0.7
`link` VARCHAR(32768) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
- `date` INT(11), -- Until year 2038
- `lastSeen` INT(11) DEFAULT 0, -- v1.1.1, Until year 2038
+ `date` BIGINT,
+ `lastSeen` BIGINT DEFAULT 0,
`hash` BINARY(16), -- v1.1.1
`is_read` BOOLEAN NOT NULL DEFAULT 0,
`is_favorite` BOOLEAN NOT NULL DEFAULT 0,
@@ -74,8 +74,8 @@ CREATE TABLE IF NOT EXISTS `_entrytmp` ( -- v1.7
`author` VARCHAR(65535),
`content_bin` MEDIUMBLOB,
`link` VARCHAR(32768) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
- `date` INT(11),
- `lastSeen` INT(11) DEFAULT 0,
+ `date` BIGINT,
+ `lastSeen` BIGINT DEFAULT 0,
`hash` BINARY(16),
`is_read` BOOLEAN NOT NULL DEFAULT 0,
`is_favorite` BOOLEAN NOT NULL DEFAULT 0,
@@ -112,3 +112,14 @@ SQL;
$GLOBALS['SQL_DROP_TABLES'] = <<<'SQL'
DROP TABLE IF EXISTS `_entrytag`, `_tag`, `_entrytmp`, `_entry`, `_feed`, `_category`;
SQL;
+
+$GLOBALS['SQL_UPDATE_YEAR_2038'] = <<<'SQL'
+ALTER TABLE `_entry` -- v1.23
+ MODIFY COLUMN `date` BIGINT,
+ MODIFY COLUMN `lastSeen` BIGINT DEFAULT 0;
+ALTER TABLE `_entrytmp`
+ MODIFY COLUMN `date` BIGINT,
+ MODIFY COLUMN `lastSeen` BIGINT DEFAULT 0;
+ALTER TABLE `_feed`
+ MODIFY COLUMN `lastUpdate` BIGINT DEFAULT 0;
+SQL;