mirror of
https://github.com/usememos/memos.git
synced 2024-12-19 17:12:02 +03:00
fix: data too large for mysql (#2470)
* Extend some TEXT field to LONGTEXT in mysql * move db migration version * fix error in migrate SQL
This commit is contained in:
parent
97190645cc
commit
b966c16dd5
@ -22,7 +22,7 @@ CREATE TABLE `migration_history` (
|
||||
-- system_setting
|
||||
CREATE TABLE `system_setting` (
|
||||
`name` VARCHAR(255) NOT NULL PRIMARY KEY,
|
||||
`value` TEXT NOT NULL,
|
||||
`value` LONGTEXT NOT NULL,
|
||||
`description` TEXT NOT NULL
|
||||
);
|
||||
|
||||
@ -37,14 +37,14 @@ CREATE TABLE `user` (
|
||||
`email` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`nickname` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`password_hash` VARCHAR(255) NOT NULL,
|
||||
`avatar_url` TEXT NOT NULL
|
||||
`avatar_url` LONGTEXT NOT NULL
|
||||
);
|
||||
|
||||
-- user_setting
|
||||
CREATE TABLE `user_setting` (
|
||||
`user_id` INT NOT NULL,
|
||||
`key` VARCHAR(255) NOT NULL,
|
||||
`value` TEXT NOT NULL,
|
||||
`value` LONGTEXT NOT NULL,
|
||||
UNIQUE(`user_id`,`key`)
|
||||
);
|
||||
|
||||
|
3
store/db/mysql/migration/prod/0.18/00__extend_text.sql
Normal file
3
store/db/mysql/migration/prod/0.18/00__extend_text.sql
Normal file
@ -0,0 +1,3 @@
|
||||
ALTER TABLE `system_setting` MODIFY `value` LONGTEXT NOT NULL;
|
||||
ALTER TABLE `user_setting` MODIFY `value` LONGTEXT NOT NULL;
|
||||
ALTER TABLE `user` MODIFY `avatar_url` LONGTEXT NOT NULL;
|
@ -22,7 +22,7 @@ CREATE TABLE `migration_history` (
|
||||
-- system_setting
|
||||
CREATE TABLE `system_setting` (
|
||||
`name` VARCHAR(255) NOT NULL PRIMARY KEY,
|
||||
`value` TEXT NOT NULL,
|
||||
`value` LONGTEXT NOT NULL,
|
||||
`description` TEXT NOT NULL
|
||||
);
|
||||
|
||||
@ -37,14 +37,14 @@ CREATE TABLE `user` (
|
||||
`email` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`nickname` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`password_hash` VARCHAR(255) NOT NULL,
|
||||
`avatar_url` TEXT NOT NULL
|
||||
`avatar_url` LONGTEXT NOT NULL
|
||||
);
|
||||
|
||||
-- user_setting
|
||||
CREATE TABLE `user_setting` (
|
||||
`user_id` INT NOT NULL,
|
||||
`key` VARCHAR(255) NOT NULL,
|
||||
`value` TEXT NOT NULL,
|
||||
`value` LONGTEXT NOT NULL,
|
||||
UNIQUE(`user_id`,`key`)
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user