Fix wrong column type for users.language

This commit is contained in:
Frederic Guillot 2015-12-06 15:05:24 -05:00
parent 8f6c064cd7
commit 7c355edc16
4 changed files with 16 additions and 6 deletions

View File

@ -6,7 +6,12 @@ use PDO;
use Kanboard\Core\Security\Token;
use Kanboard\Core\Security\Role;
const VERSION = 97;
const VERSION = 98;
function version_98(PDO $pdo)
{
$pdo->exec('ALTER TABLE `users` MODIFY `language` VARCHAR(5)');
}
function version_97(PDO $pdo)
{

View File

@ -6,7 +6,12 @@ use PDO;
use Kanboard\Core\Security\Token;
use Kanboard\Core\Security\Role;
const VERSION = 77;
const VERSION = 78;
function version_78(PDO $pdo)
{
$pdo->exec('ALTER TABLE "users" ALTER COLUMN "language" TYPE VARCHAR(5)');
}
function version_77(PDO $pdo)
{

View File

@ -548,7 +548,7 @@ CREATE TABLE `users` (
`github_id` varchar(30) DEFAULT NULL,
`notifications_enabled` tinyint(1) DEFAULT '0',
`timezone` varchar(50) DEFAULT NULL,
`language` char(5) DEFAULT NULL,
`language` varchar(5) DEFAULT NULL,
`disable_login_form` tinyint(1) DEFAULT '0',
`twofactor_activated` tinyint(1) DEFAULT '0',
`twofactor_secret` char(16) DEFAULT NULL,
@ -610,4 +610,4 @@ UNLOCK TABLES;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
INSERT INTO users (username, password, is_admin) VALUES ('admin', '$2y$10$fe3.kkCOOiOxf21QW0tEUOCo5hsL19ct4YUumL.xxTnKKMbJCUb/y', '1');INSERT INTO schema_version VALUES ('97');
INSERT INTO users (username, password, is_admin) VALUES ('admin', '$2y$10$/kXBPSpWZHnF6potELbOmuih3XlwgWHQr7dAVDHpIo96wVB22OtkO', '1');INSERT INTO schema_version VALUES ('98');

View File

@ -969,7 +969,7 @@ CREATE TABLE users (
github_id character varying(30),
notifications_enabled boolean DEFAULT false,
timezone character varying(50),
language character(5),
language character varying(5),
disable_login_form boolean DEFAULT false,
twofactor_activated boolean DEFAULT false,
twofactor_secret character(16),
@ -2066,4 +2066,4 @@ SELECT pg_catalog.setval('links_id_seq', 11, true);
-- PostgreSQL database dump complete
--
INSERT INTO users (username, password, is_admin) VALUES ('admin', '$2y$10$fe3.kkCOOiOxf21QW0tEUOCo5hsL19ct4YUumL.xxTnKKMbJCUb/y', '1');INSERT INTO schema_version VALUES ('77');
INSERT INTO users (username, password, is_admin) VALUES ('admin', '$2y$10$/kXBPSpWZHnF6potELbOmuih3XlwgWHQr7dAVDHpIo96wVB22OtkO', '1');INSERT INTO schema_version VALUES ('78');