mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-22 23:28:40 +00:00
Increase allowed length for user token in db (#328)
After update to latest version gitea and use oauth, gitea returns long token in my case it was >800 characters. DB schema of the table has varchar(500), I updated it to varchar(1000) to solve the problem. * Fix length for gitea token/secret
This commit is contained in:
parent
7f4a205764
commit
4fd8a1ef42
6 changed files with 47 additions and 0 deletions
|
@ -208,6 +208,10 @@ var migrations = []struct {
|
||||||
name: "drop-allow-push-tags-deploys-columns",
|
name: "drop-allow-push-tags-deploys-columns",
|
||||||
stmt: dropAllowPushTagsDeploysColumns,
|
stmt: dropAllowPushTagsDeploysColumns,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "update-table-set-users-token-and-secret-length",
|
||||||
|
stmt: updateTableSetUsersTokenAndSecretLength,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Migrate performs the database migration. If the migration fails
|
// Migrate performs the database migration. If the migration fails
|
||||||
|
@ -769,3 +773,11 @@ ALTER TABLE repos DROP COLUMN repo_fallback
|
||||||
var dropAllowPushTagsDeploysColumns = `
|
var dropAllowPushTagsDeploysColumns = `
|
||||||
ALTER TABLE repos DROP COLUMN repo_allow_push, DROP COLUMN repo_allow_deploys, DROP COLUMN repo_allow_tags
|
ALTER TABLE repos DROP COLUMN repo_allow_push, DROP COLUMN repo_allow_deploys, DROP COLUMN repo_allow_tags
|
||||||
`
|
`
|
||||||
|
|
||||||
|
//
|
||||||
|
// 028_update_table_set_users_token_and_secret_length.sql
|
||||||
|
//
|
||||||
|
|
||||||
|
var updateTableSetUsersTokenAndSecretLength = `
|
||||||
|
ALTER TABLE users MODIFY user_token varchar(1000), MODIFY user_secret varchar(1000);
|
||||||
|
`
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
-- name: update-table-set-users-token-and-secret-length
|
||||||
|
|
||||||
|
ALTER TABLE users MODIFY user_token varchar(1000), MODIFY user_secret varchar(1000);
|
|
@ -208,6 +208,10 @@ var migrations = []struct {
|
||||||
name: "drop-allow-push-tags-deploys-columns",
|
name: "drop-allow-push-tags-deploys-columns",
|
||||||
stmt: dropAllowPushTagsDeploysColumns,
|
stmt: dropAllowPushTagsDeploysColumns,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "update-table-set-users-token-and-secret-length",
|
||||||
|
stmt: updateTableSetUsersTokenAndSecretLength,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Migrate performs the database migration. If the migration fails
|
// Migrate performs the database migration. If the migration fails
|
||||||
|
@ -771,3 +775,12 @@ ALTER TABLE repos DROP COLUMN repo_fallback
|
||||||
var dropAllowPushTagsDeploysColumns = `
|
var dropAllowPushTagsDeploysColumns = `
|
||||||
ALTER TABLE repos DROP COLUMN repo_allow_push, DROP COLUMN repo_allow_deploys, DROP COLUMN repo_allow_tags
|
ALTER TABLE repos DROP COLUMN repo_allow_push, DROP COLUMN repo_allow_deploys, DROP COLUMN repo_allow_tags
|
||||||
`
|
`
|
||||||
|
|
||||||
|
//
|
||||||
|
// 028_update_table_set_users_token_and_secret_length.sql
|
||||||
|
//
|
||||||
|
|
||||||
|
var updateTableSetUsersTokenAndSecretLength = `
|
||||||
|
ALTER TABLE users ALTER COLUMN user_token TYPE varchar(1000);
|
||||||
|
ALTER TABLE users ALTER COLUMN user_secret TYPE varchar(1000);
|
||||||
|
`
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
-- name: update-table-set-users-token-and-secret-length
|
||||||
|
|
||||||
|
ALTER TABLE users ALTER COLUMN user_token TYPE varchar(1000);
|
||||||
|
ALTER TABLE users ALTER COLUMN user_secret TYPE varchar(1000);
|
|
@ -212,6 +212,10 @@ var migrations = []struct {
|
||||||
name: "drop-allow-push-tags-deploys-columns",
|
name: "drop-allow-push-tags-deploys-columns",
|
||||||
stmt: dropAllowPushTagsDeploysColumns,
|
stmt: dropAllowPushTagsDeploysColumns,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "update-table-set-users-token-and-secret-length",
|
||||||
|
stmt: updateTableSetUsersTokenAndSecretLength,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Migrate performs the database migration. If the migration fails
|
// Migrate performs the database migration. If the migration fails
|
||||||
|
@ -870,3 +874,11 @@ DROP TABLE repos;
|
||||||
ALTER TABLE repos_new RENAME TO repos;
|
ALTER TABLE repos_new RENAME TO repos;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
`
|
`
|
||||||
|
|
||||||
|
//
|
||||||
|
// 028_update_table_set_users_token_and_secret_length.sql
|
||||||
|
//
|
||||||
|
|
||||||
|
var updateTableSetUsersTokenAndSecretLength = `
|
||||||
|
|
||||||
|
`
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
-- name: update-table-set-users-token-and-secret-length
|
||||||
|
|
||||||
|
-- noop since sqlite do use TEXT
|
Loading…
Reference in a new issue