File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ async function migrate(db) {
4545 if ( ! exists ) {
4646 await db . schema . createTable ( 'config' , table => {
4747 table . string ( 'key' ) . primary ( )
48- table . string ( 'value' )
48+ table . text ( 'value' )
4949 } )
5050 await db ( 'config' ) . insert ( { key : 'version' , value : '0' } )
5151 }
@@ -426,4 +426,19 @@ const migrations = [
426426 const value = JSON . stringify ( settings )
427427 await db ( 'config' ) . where ( 'key' , 'settings' ) . update ( { value } )
428428 } ,
429+ // change config table 'value' column from string(255) to text
430+ async db => {
431+ await db . transaction ( async trx => {
432+ // make replacement table
433+ await trx . schema . createTable ( '_config_new' , table => {
434+ table . string ( 'key' ) . primary ( )
435+ table . text ( 'value' ) // in older versions this was string(255) but we want text
436+ } )
437+ // copy everything over
438+ await trx . raw ( 'INSERT INTO _config_new (key, value) SELECT key, value FROM config' )
439+ // swap and destroy old
440+ await trx . schema . dropTable ( 'config' )
441+ await trx . schema . renameTable ( '_config_new' , 'config' )
442+ } )
443+ } ,
429444]
You can’t perform that action at this time.
0 commit comments