add database migration from blob to mediumblob (#4568)

This commit is contained in:
ebbit1q 2022-02-09 20:11:13 +01:00 committed by GitHub
parent 252883f67e
commit 7d0a255a49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View file

@ -0,0 +1,5 @@
-- Servatrice db migration from version 28 to version 29
ALTER TABLE cockatrice_users MODIFY COLUMN avatar_bmp mediumblob NOT NULL;
UPDATE cockatrice_schema_version SET version=29 WHERE version=28;

View file

@ -20,7 +20,7 @@ CREATE TABLE IF NOT EXISTS `cockatrice_schema_version` (
PRIMARY KEY (`version`) PRIMARY KEY (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
INSERT INTO cockatrice_schema_version VALUES(28); INSERT INTO cockatrice_schema_version VALUES(29);
-- users and user data tables -- users and user data tables
CREATE TABLE IF NOT EXISTS `cockatrice_users` ( CREATE TABLE IF NOT EXISTS `cockatrice_users` (
@ -31,7 +31,7 @@ CREATE TABLE IF NOT EXISTS `cockatrice_users` (
`password_sha512` char(120) NOT NULL, `password_sha512` char(120) NOT NULL,
`email` varchar(255) NOT NULL, `email` varchar(255) NOT NULL,
`country` char(2) NOT NULL, `country` char(2) NOT NULL,
`avatar_bmp` blob NOT NULL, `avatar_bmp` mediumblob NOT NULL,
`registrationDate` datetime NOT NULL, `registrationDate` datetime NOT NULL,
`active` tinyint(1) NOT NULL, `active` tinyint(1) NOT NULL,
`token` binary(16), `token` binary(16),

View file

@ -9,7 +9,7 @@
#include <QObject> #include <QObject>
#include <QSqlDatabase> #include <QSqlDatabase>
#define DATABASE_SCHEMA_VERSION 28 #define DATABASE_SCHEMA_VERSION 29
class Servatrice; class Servatrice;