aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com>2013-07-03 12:06:15 +0200
committerJean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com>2013-07-03 12:06:15 +0200
commit7b10b42f2a8e0eaffa4b449f8939647aa4412f40 (patch)
treedb0ae0c7a1f12acaec80ea9a6f4ef2f49c14c5fb
parent5180a7250928d86fb3bb1276250af97706446780 (diff)
downloadsonarqube-7b10b42f2a8e0eaffa4b449f8939647aa4412f40.tar.gz
sonarqube-7b10b42f2a8e0eaffa4b449f8939647aa4412f40.zip
SONAR-4463 Changed join columns in permission template tables
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java9
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl6
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/416_create_permission_templates_users.rb8
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/417_create_permission_templates_groups.rb2
4 files changed, 13 insertions, 12 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java b/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java
index 59959a44502..6140c7c34d8 100644
--- a/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java
+++ b/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java
@@ -120,6 +120,7 @@ public class MyBatis implements BatchComponent, ServerComponent {
loadAlias(conf, "SnapshotData", SnapshotDataDto.class);
loadAlias(conf, "ActionPlanIssue", ActionPlanDto.class);
loadAlias(conf, "ActionPlanStats", ActionPlanStatsDto.class);
+ loadAlias(conf, "PermissionTemplate", PermissionTemplateDto.class);
// AuthorizationMapper has to be loaded before IssueMapper because this last one used it
loadMapper(conf, "org.sonar.core.user.AuthorizationMapper");
@@ -129,10 +130,10 @@ public class MyBatis implements BatchComponent, ServerComponent {
Class<?>[] mappers = {ActiveDashboardMapper.class, AuthorMapper.class, DashboardMapper.class,
DependencyMapper.class, DuplicationMapper.class, GraphDtoMapper.class,
IssueMapper.class, IssueStatsMapper.class, IssueChangeMapper.class, IssueFilterMapper.class, IssueFilterFavouriteMapper.class,
- LoadedTemplateMapper.class, MeasureFilterMapper.class, PropertiesMapper.class, PurgeMapper.class, ResourceKeyUpdaterMapper.class, ResourceIndexerMapper.class,
- ResourceSnapshotMapper.class, RoleMapper.class, RuleMapper.class, SchemaMigrationMapper.class,
- SemaphoreMapper.class, UserMapper.class, WidgetMapper.class, WidgetPropertyMapper.class, MeasureMapper.class, SnapshotDataMapper.class,
- SnapshotSourceMapper.class, ActionPlanMapper.class, ActionPlanStatsMapper.class
+ LoadedTemplateMapper.class, MeasureFilterMapper.class, PermissionTemplateMapper.class, PropertiesMapper.class, PurgeMapper.class,
+ ResourceKeyUpdaterMapper.class, ResourceIndexerMapper.class, ResourceSnapshotMapper.class, RoleMapper.class, RuleMapper.class,
+ SchemaMigrationMapper.class, SemaphoreMapper.class, UserMapper.class, WidgetMapper.class, WidgetPropertyMapper.class,
+ MeasureMapper.class, SnapshotDataMapper.class, SnapshotSourceMapper.class, ActionPlanMapper.class, ActionPlanStatsMapper.class
};
loadMappers(conf, mappers);
configureLogback(mappers);
diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl
index 76d10c54a4b..9924b3780d4 100644
--- a/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl
+++ b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl
@@ -542,8 +542,8 @@ CREATE TABLE "PERMISSION_TEMPLATES" (
CREATE TABLE "PERM_TEMPLATES_USERS" (
"ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
- "USER_LOGIN" VARCHAR(40) NOT NULL,
- "TEMPLATE_NAME" VARCHAR(100) NOT NULL,
+ "USER_ID" INTEGER NOT NULL,
+ "TEMPLATE_ID" INTEGER NOT NULL,
"CREATED_AT" TIMESTAMP,
"UPDATED_AT" TIMESTAMP
);
@@ -551,7 +551,7 @@ CREATE TABLE "PERM_TEMPLATES_USERS" (
CREATE TABLE "PERM_TEMPLATES_GROUPS" (
"ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
"GROUP_ID" INTEGER,
- "TEMPLATE_NAME" VARCHAR(100) NOT NULL,
+ "TEMPLATE_ID" INTEGER NOT NULL,
"CREATED_AT" TIMESTAMP,
"UPDATED_AT" TIMESTAMP
);
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/416_create_permission_templates_users.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/416_create_permission_templates_users.rb
index ee85d9378b2..1c5094ddefe 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/416_create_permission_templates_users.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/416_create_permission_templates_users.rb
@@ -25,10 +25,10 @@ class CreatePermissionTemplatesUsers < ActiveRecord::Migration
def self.up
create_table :perm_templates_users do |t|
- t.column :user_login, :string, :null => false, :limit => 40
- t.column :template_name, :string, :null => false, :limit => 100
- t.column :created_at, :datetime, :null => true
- t.column :updated_at, :datetime, :null => true
+ t.column :user_id, :integer, :null => false
+ t.column :template_id, :integer, :null => false
+ t.column :created_at, :datetime, :null => true
+ t.column :updated_at, :datetime, :null => true
end
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/417_create_permission_templates_groups.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/417_create_permission_templates_groups.rb
index 6ad66c99515..d63b8ec1dac 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/417_create_permission_templates_groups.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/417_create_permission_templates_groups.rb
@@ -26,7 +26,7 @@ class CreatePermissionTemplatesGroups < ActiveRecord::Migration
def self.up
create_table :perm_templates_groups do |t|
t.column :group_id, :integer, :null => true
- t.column :template_name, :string, :null => false, :limit => 100
+ t.column :template_id, :integer, :null => false
t.column :created_at, :datetime, :null => true
t.column :updated_at, :datetime, :null => true
end