Change config value datatype

Fixes #167
This commit is contained in:
Jan Eitzinger 2023-06-29 14:55:38 +02:00
parent 7174f27a89
commit dd80d5af9e
5 changed files with 11 additions and 1 deletions

View File

@ -16,7 +16,7 @@ import (
"github.com/golang-migrate/migrate/v4/source/iofs" "github.com/golang-migrate/migrate/v4/source/iofs"
) )
const Version uint = 5 const Version uint = 6
//go:embed migrations/* //go:embed migrations/*
var migrationFiles embed.FS var migrationFiles embed.FS

View File

@ -0,0 +1 @@
ALTER TABLE configuration MODIFY value VARCHAR(255);

View File

@ -0,0 +1 @@
ALTER TABLE configuration MODIFY value TEXT;

View File

@ -0,0 +1,4 @@
ALTER TABLE configuration ADD COLUMN value_new varchar(255);
INSERT INTO configuration (value_new) SELECT value FROM configuration;
ALTER TABLE configuration DROP COLUMN value;
ALTER TABLE configuration RENAME COLUMN value_new TO value;

View File

@ -0,0 +1,4 @@
ALTER TABLE configuration ADD COLUMN value_new TEXT;
INSERT INTO configuration (value_new) SELECT value FROM configuration;
ALTER TABLE configuration DROP COLUMN value;
ALTER TABLE configuration RENAME COLUMN value_new TO value;