From ac6428a4a218bc311e3707b3d86c0d3c6ba67e4b Mon Sep 17 00:00:00 2001 From: Teryk Bellahsene Date: Tue, 24 Nov 2015 11:48:50 +0100 Subject: [PATCH] Fix index size limit of user_tokens_login_name --- .../main/webapp/WEB-INF/db/migrate/1000_create_user_tokens.rb | 2 +- sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl | 2 +- sonar-db/src/test/java/org/sonar/db/user/UserTokenTesting.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1000_create_user_tokens.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1000_create_user_tokens.rb index 6eb27e67200..48448b8ec20 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1000_create_user_tokens.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1000_create_user_tokens.rb @@ -26,7 +26,7 @@ class CreateUserTokens < ActiveRecord::Migration def self.up create_table 'user_tokens' do |t| t.column 'login', :string, :limit => 255, :null => false - t.column 'name', :string, :limit => 255, :null => false + t.column 'name', :string, :limit => 100, :null => false t.column 'token_hash', :string, :limit => 255, :null => false t.column 'created_at', :big_integer, :null => false end diff --git a/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl b/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl index 403d58addd2..ec38443f492 100644 --- a/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl +++ b/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl @@ -554,7 +554,7 @@ CREATE TABLE "CE_ACTIVITY" ( CREATE TABLE "USER_TOKENS" ( "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), "LOGIN" VARCHAR(255) NOT NULL, - "NAME" VARCHAR(255) NOT NULL, + "NAME" VARCHAR(100) NOT NULL, "TOKEN_HASH" VARCHAR(255) NOT NULL, "CREATED_AT" BIGINT NOT NULL ); diff --git a/sonar-db/src/test/java/org/sonar/db/user/UserTokenTesting.java b/sonar-db/src/test/java/org/sonar/db/user/UserTokenTesting.java index 84536ed7265..b1a0ba512f5 100644 --- a/sonar-db/src/test/java/org/sonar/db/user/UserTokenTesting.java +++ b/sonar-db/src/test/java/org/sonar/db/user/UserTokenTesting.java @@ -27,7 +27,7 @@ public class UserTokenTesting { public static UserTokenDto newUserToken() { return new UserTokenDto() .setLogin(randomAlphanumeric(255)) - .setName(randomAlphanumeric(255)) + .setName(randomAlphanumeric(100)) .setTokenHash(randomAlphanumeric(40)) .setCreatedAt(nextLong()); } -- 2.39.5