Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

LPS-26306 Cleanup SQL references

  • Loading branch information...
commit 1afa11f8adc19fdcca8226e5bd8000e0f4e3b9d7 1 parent 2c0fe1e
Raymond Augé authored April 05, 2012 brianchandotcom committed April 05, 2012
1  .gitignore
@@ -161,6 +161,7 @@ _sass_cache_*.css
161 161
 /sql/sequences
162 162
 /sql/sql.*.properties
163 163
 /sql/update-*
  164
+!/sql/update-*.sql
164 165
 /sql/velocity.log*
165 166
 
166 167
 /support-tomcat/*.iml
36  portal-impl/src/com/liferay/portal/upgrade/UpgradeProcess_6_1_0_to_6_2_0.java
... ...
@@ -0,0 +1,36 @@
  1
+/**
  2
+ * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
  3
+ *
  4
+ * This library is free software; you can redistribute it and/or modify it under
  5
+ * the terms of the GNU Lesser General Public License as published by the Free
  6
+ * Software Foundation; either version 2.1 of the License, or (at your option)
  7
+ * any later version.
  8
+ *
  9
+ * This library is distributed in the hope that it will be useful, but WITHOUT
  10
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  12
+ * details.
  13
+ */
  14
+
  15
+package com.liferay.portal.upgrade;
  16
+
  17
+import com.liferay.portal.kernel.upgrade.UpgradeProcess;
  18
+import com.liferay.portal.kernel.util.ReleaseInfo;
  19
+import com.liferay.portal.upgrade.v6_1_0_to_6_2_0.UpgradeSchema;
  20
+
  21
+/**
  22
+ * @author Raymond Augé
  23
+ */
  24
+public class UpgradeProcess_6_1_0_to_6_2_0 extends UpgradeProcess {
  25
+
  26
+	@Override
  27
+	public int getThreshold() {
  28
+		return ReleaseInfo.RELEASE_6_1_0_BUILD_NUMBER;
  29
+	}
  30
+
  31
+	@Override
  32
+	protected void doUpgrade() throws Exception {
  33
+		upgrade(UpgradeSchema.class);
  34
+	}
  35
+
  36
+}
36  portal-impl/src/com/liferay/portal/upgrade/UpgradeProcess_6_1_1_to_6_2_0.java
... ...
@@ -0,0 +1,36 @@
  1
+/**
  2
+ * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
  3
+ *
  4
+ * This library is free software; you can redistribute it and/or modify it under
  5
+ * the terms of the GNU Lesser General Public License as published by the Free
  6
+ * Software Foundation; either version 2.1 of the License, or (at your option)
  7
+ * any later version.
  8
+ *
  9
+ * This library is distributed in the hope that it will be useful, but WITHOUT
  10
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  12
+ * details.
  13
+ */
  14
+
  15
+package com.liferay.portal.upgrade;
  16
+
  17
+import com.liferay.portal.kernel.upgrade.UpgradeProcess;
  18
+import com.liferay.portal.kernel.util.ReleaseInfo;
  19
+import com.liferay.portal.upgrade.v6_1_1_to_6_2_0.UpgradeSchema;
  20
+
  21
+/**
  22
+ * @author Raymond Augé
  23
+ */
  24
+public class UpgradeProcess_6_1_1_to_6_2_0 extends UpgradeProcess {
  25
+
  26
+	@Override
  27
+	public int getThreshold() {
  28
+		return ReleaseInfo.RELEASE_6_1_1_BUILD_NUMBER;
  29
+	}
  30
+
  31
+	@Override
  32
+	protected void doUpgrade() throws Exception {
  33
+		upgrade(UpgradeSchema.class);
  34
+	}
  35
+
  36
+}
29  portal-impl/src/com/liferay/portal/upgrade/v6_1_0_to_6_2_0/UpgradeSchema.java
... ...
@@ -0,0 +1,29 @@
  1
+/**
  2
+ * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
  3
+ *
  4
+ * This library is free software; you can redistribute it and/or modify it under
  5
+ * the terms of the GNU Lesser General Public License as published by the Free
  6
+ * Software Foundation; either version 2.1 of the License, or (at your option)
  7
+ * any later version.
  8
+ *
  9
+ * This library is distributed in the hope that it will be useful, but WITHOUT
  10
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  12
+ * details.
  13
+ */
  14
+
  15
+package com.liferay.portal.upgrade.v6_1_0_to_6_2_0;
  16
+
  17
+import com.liferay.portal.kernel.upgrade.UpgradeProcess;
  18
+
  19
+/**
  20
+ * @author Raymond Augé
  21
+ */
  22
+public class UpgradeSchema extends UpgradeProcess {
  23
+
  24
+	@Override
  25
+	protected void doUpgrade() throws Exception {
  26
+		runSQLTemplate("update-6.1.0-6.2.0.sql", false);
  27
+	}
  28
+
  29
+}
29  portal-impl/src/com/liferay/portal/upgrade/v6_1_1_to_6_2_0/UpgradeSchema.java
... ...
@@ -0,0 +1,29 @@
  1
+/**
  2
+ * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
  3
+ *
  4
+ * This library is free software; you can redistribute it and/or modify it under
  5
+ * the terms of the GNU Lesser General Public License as published by the Free
  6
+ * Software Foundation; either version 2.1 of the License, or (at your option)
  7
+ * any later version.
  8
+ *
  9
+ * This library is distributed in the hope that it will be useful, but WITHOUT
  10
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  12
+ * details.
  13
+ */
  14
+
  15
+package com.liferay.portal.upgrade.v6_1_1_to_6_2_0;
  16
+
  17
+import com.liferay.portal.kernel.upgrade.UpgradeProcess;
  18
+
  19
+/**
  20
+ * @author Raymond Augé
  21
+ */
  22
+public class UpgradeSchema extends UpgradeProcess {
  23
+
  24
+	@Override
  25
+	protected void doUpgrade() throws Exception {
  26
+		runSQLTemplate("update-6.1.1-6.2.0.sql", false);
  27
+	}
  28
+
  29
+}
475  portal-impl/src/custom-sql/portal.xml
@@ -255,28 +255,6 @@
255 255
 				(LayoutSet.pageCount != 0)
256 256
 		]]>
257 257
 	</sql>
258  
-	<sql id="com.liferay.portal.service.persistence.GroupFinder.joinByRolePermissions">
259  
-		<![CDATA[
260  
-			INNER JOIN
261  
-				Resource_ ON
262  
-					(Resource_.primKey = CAST_TEXT(Group_.groupId))
263  
-			INNER JOIN
264  
-				ResourceCode ON
265  
-					(ResourceCode.codeId = Resource_.codeId)
266  
-			INNER JOIN
267  
-				Permission_ ON
268  
-					(Permission_.resourceId = Resource_.resourceId)
269  
-			INNER JOIN
270  
-				Roles_Permissions ON
271  
-					(Roles_Permissions.permissionId = Permission_.permissionId)
272  
-			WHERE
273  
-				(Group_.liveGroupId = 0) AND
274  
-				(ResourceCode.name = ?) AND
275  
-				(ResourceCode.scope = ?) AND
276  
-				(Permission_.actionId = ?) AND
277  
-				(Roles_Permissions.roleId = ?)
278  
-		]]>
279  
-	</sql>
280 258
 	<sql id="com.liferay.portal.service.persistence.GroupFinder.joinByRoleResourcePermissions">
281 259
 		<![CDATA[
282 260
 			INNER JOIN
@@ -568,22 +546,6 @@
568 546
 				)
569 547
 		]]>
570 548
 	</sql>
571  
-	<sql id="com.liferay.portal.service.persistence.OrganizationFinder.joinByGroupsPermissions">
572  
-		<![CDATA[
573  
-			INNER JOIN
574  
-				Group_ ON
575  
-					(Group_.classPK = Organization_.organizationId)
576  
-			INNER JOIN
577  
-				Groups_Permissions ON
578  
-					(Groups_Permissions.groupId = Group_.groupId)
579  
-			INNER JOIN
580  
-				Permission_ ON
581  
-					(Permission_.permissionId = Groups_Permissions.permissionId)
582  
-			WHERE
583  
-				(Group_.classNameId = [$CLASS_NAME_ID_COM.LIFERAY.PORTAL.MODEL.ORGANIZATION$]) AND
584  
-				(Permission_.resourceId = ?)
585  
-		]]>
586  
-	</sql>
587 549
 	<sql id="com.liferay.portal.service.persistence.OrganizationFinder.joinByOrganizationsGroups">
588 550
 		<![CDATA[
589 551
 			INNER JOIN
@@ -625,19 +587,6 @@
625 587
 				(Users_Orgs.userId = ?)
626 588
 		]]>
627 589
 	</sql>
628  
-	<sql id="com.liferay.portal.service.persistence.OrganizationFinder.joinByOrgGroupPermission">
629  
-		<![CDATA[
630  
-			INNER JOIN
631  
-				OrgGroupPermission ON
632  
-					(OrgGroupPermission.organizationId = Organization_.organizationId)
633  
-			INNER JOIN
634  
-				Permission_ ON
635  
-					(Permission_.permissionId = OrgGroupPermission.permissionId)
636  
-			WHERE
637  
-				(Permission_.resourceId = ?) AND
638  
-				(OrgGroupPermission.groupId = ?)
639  
-		]]>
640  
-	</sql>
641 590
 	<sql id="com.liferay.portal.service.persistence.OrganizationFinder.joinByUsersOrgs">
642 591
 		<![CDATA[
643 592
 			INNER JOIN
@@ -647,21 +596,6 @@
647 596
 				(Users_Orgs.organizationId = Organization_.organizationId)
648 597
 		]]>
649 598
 	</sql>
650  
-	<sql id="com.liferay.portal.service.persistence.OrgGroupPermissionFinder.findByO_G_R">
651  
-		<![CDATA[
652  
-			SELECT
653  
-				{OrgGroupPermission.*}
654  
-			FROM
655  
-				OrgGroupPermission
656  
-			INNER JOIN
657  
-				Permission_ ON
658  
-					(Permission_.permissionId = OrgGroupPermission.permissionId)
659  
-			WHERE
660  
-				(Permission_.resourceId = ?) AND
661  
-				(OrgGroupPermission.organizationId = ?) AND
662  
-				(OrgGroupPermission.groupId = ?)
663  
-		]]>
664  
-	</sql>
665 599
 	<sql id="com.liferay.portal.service.persistence.PasswordPolicyFinder.countByC_N">
666 600
 		<![CDATA[
667 601
 			SELECT
@@ -684,280 +618,6 @@
684 618
 				(lower(PasswordPolicy.name) LIKE ? OR ? IS NULL)
685 619
 		]]>
686 620
 	</sql>
687  
-	<sql id="com.liferay.portal.service.persistence.PermissionFinder.countByGroupsPermissions">
688  
-		<![CDATA[
689  
-			SELECT
690  
-				COUNT(*) AS COUNT_VALUE
691  
-			FROM
692  
-				Permission_
693  
-			INNER JOIN
694  
-				Groups_Permissions ON
695  
-					(Groups_Permissions.permissionId = Permission_.permissionId)
696  
-			WHERE
697  
-				([$PERMISSION_ID$]) AND
698  
-				([$GROUP_ID$])
699  
-		]]>
700  
-	</sql>
701  
-	<sql id="com.liferay.portal.service.persistence.PermissionFinder.countByGroupsRoles">
702  
-		<![CDATA[
703  
-			SELECT
704  
-				COUNT(*) AS COUNT_VALUE
705  
-			FROM
706  
-				Groups_Roles
707  
-			INNER JOIN
708  
-				Roles_Permissions ON
709  
-					(Roles_Permissions.roleId = Groups_Roles.roleId)
710  
-			INNER JOIN
711  
-				Permission_ ON
712  
-					(Permission_.permissionId = Roles_Permissions.permissionId)
713  
-			WHERE
714  
-				([$PERMISSION_ID$]) AND
715  
-				([$GROUP_ID$])
716  
-		]]>
717  
-	</sql>
718  
-	<sql id="com.liferay.portal.service.persistence.PermissionFinder.countByRolesPermissions">
719  
-		<![CDATA[
720  
-			SELECT
721  
-				COUNT(*) AS COUNT_VALUE
722  
-			FROM
723  
-				Roles_Permissions
724  
-			WHERE
725  
-				([$PERMISSION_ID$]) AND
726  
-				([$ROLE_ID$])
727  
-		]]>
728  
-	</sql>
729  
-	<sql id="com.liferay.portal.service.persistence.PermissionFinder.countByUserGroupRole">
730  
-		<![CDATA[
731  
-			SELECT
732  
-				COUNT(*) AS COUNT_VALUE
733  
-			FROM
734  
-				UserGroupRole
735  
-			INNER JOIN
736  
-				Roles_Permissions ON
737  
-					(Roles_Permissions.roleId = UserGroupRole.roleId) AND
738  
-					(UserGroupRole.groupId = ?)
739  
-			INNER JOIN
740  
-				Permission_ ON
741  
-					(Permission_.permissionId = Roles_Permissions.permissionId)
742  
-			WHERE
743  
-				([$PERMISSION_ID$]) AND
744  
-				(UserGroupRole.userId = ?)
745  
-		]]>
746  
-	</sql>
747  
-	<sql id="com.liferay.portal.service.persistence.PermissionFinder.countByUsersPermissions">
748  
-		<![CDATA[
749  
-			SELECT
750  
-				COUNT(*) AS COUNT_VALUE
751  
-			FROM
752  
-				Permission_
753  
-			INNER JOIN
754  
-				Users_Permissions ON
755  
-					(Users_Permissions.permissionId = Permission_.permissionId)
756  
-			WHERE
757  
-				([$PERMISSION_ID$]) AND
758  
-				(Users_Permissions.userId = ?)
759  
-		]]>
760  
-	</sql>
761  
-	<sql id="com.liferay.portal.service.persistence.PermissionFinder.countByUsersRoles">
762  
-		<![CDATA[
763  
-			SELECT
764  
-				COUNT(*) AS COUNT_VALUE
765  
-			FROM
766  
-				Users_Roles
767  
-			INNER JOIN
768  
-				Roles_Permissions ON
769  
-					(Roles_Permissions.roleId = Users_Roles.roleId)
770  
-			INNER JOIN
771  
-				Permission_ ON
772  
-					(Permission_.permissionId = Roles_Permissions.permissionId)
773  
-			WHERE
774  
-				([$PERMISSION_ID$]) AND
775  
-				(Users_Roles.userId = ?)
776  
-		]]>
777  
-	</sql>
778  
-	<sql id="com.liferay.portal.service.persistence.PermissionFinder.countByR_A_C">
779  
-		<![CDATA[
780  
-			SELECT
781  
-				COUNT(*) AS COUNT_VALUE
782  
-			FROM
783  
-				Roles_Permissions
784  
-			INNER JOIN
785  
-				Permission_ ON
786  
-					(Permission_.permissionId = Roles_Permissions.permissionId)
787  
-			INNER JOIN
788  
-				Resource_ ON
789  
-					(Resource_.resourceId = Permission_.resourceId)
790  
-			WHERE
791  
-				(Roles_Permissions.roleId = ?) AND
792  
-				(Permission_.actionId = ?) AND
793  
-				(Resource_.codeId = ?)
794  
-		]]>
795  
-	</sql>
796  
-	<sql id="com.liferay.portal.service.persistence.PermissionFinder.findByA_C">
797  
-		<![CDATA[
798  
-			SELECT
799  
-				{Permission_.*}
800  
-			FROM
801  
-				Permission_
802  
-			INNER JOIN
803  
-				Resource_ ON
804  
-					(Resource_.resourceId = Permission_.resourceId)
805  
-			WHERE
806  
-				(Permission_.actionId = ?) AND
807  
-				(Resource_.codeId = ?)
808  
-		]]>
809  
-	</sql>
810  
-	<sql id="com.liferay.portal.service.persistence.PermissionFinder.findByA_R">
811  
-		<![CDATA[
812  
-			SELECT
813  
-				{Permission_.*}
814  
-			FROM
815  
-				Permission_
816  
-			WHERE
817  
-				(actionId = ?) AND
818  
-				([$RESOURCE_ID$])
819  
-		]]>
820  
-	</sql>
821  
-	<sql id="com.liferay.portal.service.persistence.PermissionFinder.findByG_R">
822  
-		<![CDATA[
823  
-			SELECT
824  
-				{Permission_.*}
825  
-			FROM
826  
-				Permission_
827  
-			INNER JOIN
828  
-				Groups_Permissions ON
829  
-					(Groups_Permissions.permissionId = Permission_.permissionId)
830  
-			WHERE
831  
-				(Groups_Permissions.groupId = ?) AND
832  
-				(Permission_.resourceId = ?)
833  
-		]]>
834  
-	</sql>
835  
-	<sql id="com.liferay.portal.service.persistence.PermissionFinder.findByR_R">
836  
-		<![CDATA[
837  
-			SELECT
838  
-				{Permission_.*}
839  
-			FROM
840  
-				Permission_
841  
-			INNER JOIN
842  
-				Roles_Permissions ON
843  
-					(Roles_Permissions.permissionId = Permission_.permissionId)
844  
-			WHERE
845  
-				(Roles_Permissions.roleId = ?) AND
846  
-				(Permission_.resourceId = ?)
847  
-			ORDER BY
848  
-				Permission_.actionId ASC
849  
-		]]>
850  
-	</sql>
851  
-	<sql id="com.liferay.portal.service.persistence.PermissionFinder.findByR_S">
852  
-		<![CDATA[
853  
-			SELECT
854  
-				{Permission_.*}
855  
-			FROM
856  
-				Permission_
857  
-			INNER JOIN
858  
-				Roles_Permissions ON
859  
-					(Roles_Permissions.permissionId = Permission_.permissionId)
860  
-			INNER JOIN
861  
-				Resource_ ON
862  
-					(Resource_.resourceId = Permission_.resourceId)
863  
-			INNER JOIN
864  
-				ResourceCode ON
865  
-					(ResourceCode.codeId = Resource_.codeId)
866  
-			WHERE
867  
-				(Roles_Permissions.roleId = ?) AND
868  
-				[$SCOPE$]
869  
-		]]>
870  
-	</sql>
871  
-	<sql id="com.liferay.portal.service.persistence.PermissionFinder.findByU_R">
872  
-		<![CDATA[
873  
-			SELECT
874  
-				{Permission_.*}
875  
-			FROM
876  
-				Permission_
877  
-			INNER JOIN
878  
-				Users_Permissions ON
879  
-					(Users_Permissions.permissionId = Permission_.permissionId)
880  
-			WHERE
881  
-				(Users_Permissions.userId = ?) AND
882  
-				(Permission_.resourceId = ?)
883  
-		]]>
884  
-	</sql>
885  
-	<sql id="com.liferay.portal.service.persistence.PermissionFinder.findByO_G_R">
886  
-		<![CDATA[
887  
-			SELECT
888  
-				{Permission_.*}
889  
-			FROM
890  
-				Permission_
891  
-			INNER JOIN
892  
-				OrgGroupPermission ON
893  
-					(OrgGroupPermission.permissionId = Permission_.permissionId)
894  
-			WHERE
895  
-				(OrgGroupPermission.organizationId = ?) AND
896  
-				(OrgGroupPermission.groupId = ?) AND
897  
-				(Permission_.resourceId = ?)
898  
-		]]>
899  
-	</sql>
900  
-	<sql id="com.liferay.portal.service.persistence.PermissionFinder.findByU_A_R">
901  
-		<![CDATA[
902  
-			SELECT
903  
-				{Permission_.*}
904  
-			FROM
905  
-				Permission_
906  
-			INNER JOIN
907  
-				Users_Permissions ON
908  
-					(Users_Permissions.permissionId = Permission_.permissionId)
909  
-			WHERE
910  
-				(Users_Permissions.userId = ?) AND
911  
-				([$ACTION_ID$]) AND
912  
-				(Permission_.resourceId = ?)
913  
-		]]>
914  
-	</sql>
915  
-	<sql id="com.liferay.portal.service.persistence.PermissionFinder.findByG_C_N_S_P">
916  
-		<![CDATA[
917  
-			SELECT
918  
-				{Permission_.*}
919  
-			FROM
920  
-				Permission_
921  
-			INNER JOIN
922  
-				Resource_ ON
923  
-					(Resource_.resourceId = Permission_.resourceId)
924  
-			INNER JOIN
925  
-				ResourceCode ON
926  
-					(ResourceCode.codeId = Resource_.codeId)
927  
-			INNER JOIN
928  
-				Groups_Permissions ON
929  
-					(Groups_Permissions.permissionId = Permission_.permissionId)
930  
-			WHERE
931  
-				(Groups_Permissions.groupId = ?) AND
932  
-				(ResourceCode.companyId = ?) AND
933  
-				(ResourceCode.name = ?) AND
934  
-				(ResourceCode.scope = ?) AND
935  
-				(Resource_.primKey = ?)
936  
-		]]>
937  
-	</sql>
938  
-	<sql id="com.liferay.portal.service.persistence.PermissionFinder.findByU_C_N_S_P">
939  
-		<![CDATA[
940  
-			SELECT
941  
-				{Permission_.*}
942  
-			FROM
943  
-				Permission_
944  
-			INNER JOIN
945  
-				Resource_ ON
946  
-					(Resource_.resourceId = Permission_.resourceId)
947  
-			INNER JOIN
948  
-				ResourceCode ON
949  
-					(ResourceCode.codeId = Resource_.codeId)
950  
-			INNER JOIN
951  
-				Users_Permissions ON
952  
-					(Users_Permissions.permissionId = Permission_.permissionId)
953  
-			WHERE
954  
-				(Users_Permissions.userId = ?) AND
955  
-				(ResourceCode.companyId = ?) AND
956  
-				(ResourceCode.name = ?) AND
957  
-				(ResourceCode.scope = ?) AND
958  
-				(Resource_.primKey = ?)
959  
-		]]>
960  
-	</sql>
961 621
 	<sql id="com.liferay.portal.service.persistence.PortletPreferencesFinder.findByPortletId">
962 622
 		<![CDATA[
963 623
 			SELECT
@@ -1005,74 +665,6 @@
1005 665
 				(ResourceBlock.name = ?)
1006 666
 		]]>
1007 667
 	</sql>
1008  
-	<sql id="com.liferay.portal.service.persistence.ResourceFinder.findByContainerResource">
1009  
-		<![CDATA[
1010  
-			SELECT
1011  
-				{Resource_.*}
1012  
-			FROM
1013  
-				Resource_
1014  
-			INNER JOIN
1015  
-				Group_ ON
1016  
-					(Resource_.codeId = ?) AND
1017  
-					(Resource_.primKey = CAST_TEXT(Group_.groupId))
1018  
-		]]>
1019  
-	</sql>
1020  
-	<sql id="com.liferay.portal.service.persistence.ResourceFinder.findByName">
1021  
-		<![CDATA[
1022  
-			SELECT
1023  
-				{Resource_.*}
1024  
-			FROM
1025  
-				Resource_
1026  
-			INNER JOIN
1027  
-				ResourceCode ON
1028  
-					(ResourceCode.codeId = Resource_.codeId)
1029  
-			WHERE
1030  
-				(ResourceCode.name = ?)
1031  
-		]]>
1032  
-	</sql>
1033  
-	<sql id="com.liferay.portal.service.persistence.ResourceFinder.findByNoActions">
1034  
-		<![CDATA[
1035  
-			SELECT
1036  
-				{Resource_.*}
1037  
-			FROM
1038  
-				Resource_
1039  
-			LEFT OUTER JOIN
1040  
-				Permission_ ON
1041  
-					(Permission_.resourceId = Resource_.resourceId) AND
1042  
-					(Permission_.actionId = ?)
1043  
-			WHERE
1044  
-				(Resource_.codeId = ?) AND
1045  
-				(Permission_.actionId IS NULL)
1046  
-		]]>
1047  
-	</sql>
1048  
-	<sql id="com.liferay.portal.service.persistence.ResourceFinder.findByC_P">
1049  
-		<![CDATA[
1050  
-			SELECT
1051  
-				{Resource_.*}
1052  
-			FROM
1053  
-				Resource_
1054  
-			INNER JOIN
1055  
-				ResourceCode ON
1056  
-					(ResourceCode.codeId = Resource_.codeId)
1057  
-			WHERE
1058  
-				(ResourceCode.companyId = ?) AND
1059  
-				(Resource_.primKey LIKE ?)
1060  
-		]]>
1061  
-	</sql>
1062  
-	<sql id="com.liferay.portal.service.persistence.ResourceFinder.findByN_S">
1063  
-		<![CDATA[
1064  
-			SELECT
1065  
-				{Resource_.*}
1066  
-			FROM
1067  
-				Resource_
1068  
-			INNER JOIN
1069  
-				ResourceCode ON
1070  
-					(ResourceCode.codeId = Resource_.codeId)
1071  
-			WHERE
1072  
-				(ResourceCode.name = ?) AND
1073  
-				(ResourceCode.scope = ?)
1074  
-		]]>
1075  
-	</sql>
1076 668
 	<sql id="com.liferay.portal.service.persistence.ResourcePermissionFinder.countByR_S">
1077 669
 		<![CDATA[
1078 670
 			SELECT
@@ -1420,33 +1012,6 @@
1420 1012
 				Role_.name ASC
1421 1013
 		]]>
1422 1014
 	</sql>
1423  
-	<sql id="com.liferay.portal.service.persistence.RoleFinder.findByC_N_S_P">
1424  
-		<![CDATA[
1425  
-			SELECT
1426  
-				Role_.name AS roleName, Permission_.actionId AS actionId
1427  
-			FROM
1428  
-				Permission_
1429  
-			INNER JOIN
1430  
-				Resource_ ON
1431  
-					(Resource_.resourceId = Permission_.resourceId)
1432  
-			INNER JOIN
1433  
-				ResourceCode ON
1434  
-					(ResourceCode.codeId = Resource_.codeId)
1435  
-			INNER JOIN
1436  
-				Roles_Permissions ON
1437  
-					(Roles_Permissions.permissionId = Permission_.permissionId)
1438  
-			INNER JOIN
1439  
-				Role_ ON
1440  
-					(Role_.roleId = Roles_Permissions.roleId)
1441  
-			WHERE
1442  
-				(ResourceCode.companyId = ?) AND
1443  
-				(ResourceCode.name = ?) AND
1444  
-				(ResourceCode.scope = ?) AND
1445  
-				(Resource_.primKey = ?)
1446  
-			ORDER BY
1447  
-				Role_.name ASC
1448  
-		]]>
1449  
-	</sql>
1450 1015
 	<sql id="com.liferay.portal.service.persistence.RoleFinder.findByC_N_S_P_A">
1451 1016
 		<![CDATA[
1452 1017
 			SELECT
@@ -1470,18 +1035,6 @@
1470 1035
 				Role_.name ASC
1471 1036
 		]]>
1472 1037
 	</sql>
1473  
-	<sql id="com.liferay.portal.service.persistence.RoleFinder.joinByRolesPermissions">
1474  
-		<![CDATA[
1475  
-			INNER JOIN
1476  
-				Roles_Permissions ON
1477  
-					(Roles_Permissions.roleId = Role_.roleId)
1478  
-			INNER JOIN
1479  
-				Permission_ ON
1480  
-					(Permission_.permissionId = Roles_Permissions.permissionId)
1481  
-			WHERE
1482  
-				(Permission_.resourceId = ?)
1483  
-		]]>
1484  
-	</sql>
1485 1038
 	<sql id="com.liferay.portal.service.persistence.RoleFinder.joinByUsersRoles">
1486 1039
 		<![CDATA[
1487 1040
 			INNER JOIN
@@ -1675,18 +1228,6 @@
1675 1228
 				))
1676 1229
 		]]>
1677 1230
 	</sql>
1678  
-	<sql id="com.liferay.portal.service.persistence.UserFinder.joinByPermission">
1679  
-		<![CDATA[
1680  
-			INNER JOIN
1681  
-				Users_Permissions ON
1682  
-					(Users_Permissions.userId = User_.userId)
1683  
-			INNER JOIN
1684  
-				Permission_ ON
1685  
-					(Permission_.permissionId = Users_Permissions.permissionId)
1686  
-			WHERE
1687  
-				(Permission_.resourceId = ?)
1688  
-		]]>
1689  
-	</sql>
1690 1231
 	<sql id="com.liferay.portal.service.persistence.UserFinder.joinByUserGroupRole">
1691 1232
 		<![CDATA[
1692 1233
 			INNER JOIN
@@ -1868,22 +1409,6 @@
1868 1409
 				UserGroup.name ASC
1869 1410
 		]]>
1870 1411
 	</sql>
1871  
-	<sql id="com.liferay.portal.service.persistence.UserGroupFinder.joinByGroupsPermissions">
1872  
-		<![CDATA[
1873  
-			INNER JOIN
1874  
-				Group_ ON
1875  
-					(Group_.classPK = UserGroup.userGroupId)
1876  
-			INNER JOIN
1877  
-				Groups_Permissions ON
1878  
-					(Groups_Permissions.groupId = Group_.groupId)
1879  
-			INNER JOIN
1880  
-				Permission_ ON
1881  
-					(Permission_.permissionId = Groups_Permissions.permissionId)
1882  
-			WHERE
1883  
-				(Group_.classNameId = [$CLASS_NAME_ID_COM.LIFERAY.PORTAL.MODEL.USERGROUP$]) AND
1884  
-				(Permission_.resourceId = ?)
1885  
-		]]>
1886  
-	</sql>
1887 1412
 	<sql id="com.liferay.portal.service.persistence.UserGroupFinder.joinByUserGroupGroupRole">
1888 1413
 		<![CDATA[
1889 1414
 			INNER JOIN
3  portal-impl/src/portal.properties
@@ -145,7 +145,8 @@
145 145
         com.liferay.portal.upgrade.UpgradeProcess_6_0_5\,\
146 146
         com.liferay.portal.upgrade.UpgradeProcess_6_0_6\,\
147 147
         com.liferay.portal.upgrade.UpgradeProcess_6_1_0\,\
148  
-        com.liferay.portal.upgrade.UpgradeProcess_6_1_1
  148
+        com.liferay.portal.upgrade.UpgradeProcess_6_1_1\,\
  149
+        com.liferay.portal.upgrade.UpgradeProcess_6_1_1_to_6_2_0
149 150
 
150 151
     upgrade.processes.6000=${upgrade.processes.master}
151 152
     upgrade.processes.6001=${upgrade.processes.master}
22  sql/indexes.properties
@@ -281,9 +281,6 @@ IX_7B590A7A=Group_.T_A
281 281
 IX_75267DCA=Groups_Orgs.groupId
282 282
 IX_6BBB7682=Groups_Orgs.organizationId
283 283
 
284  
-IX_C48736B=Groups_Permissions.groupId
285  
-IX_EC97689D=Groups_Permissions.permissionId
286  
-
287 284
 IX_84471FD2=Groups_Roles.groupId
288 285
 IX_3103EF3D=Groups_Roles.roleId
289 286
 
@@ -504,9 +501,6 @@ IX_35AA8FA6=MembershipRequest.G_U_S
504 501
 IX_8A1CC4B=MembershipRequest.GroupId
505 502
 IX_66D70879=MembershipRequest.UserId
506 503
 
507  
-IX_A425F71A=OrgGroupPermission.GroupId
508  
-IX_6C53DA4E=OrgGroupPermission.PermissionId
509  
-
510 504
 IX_4A527DD3=OrgGroupRole.GroupId
511 505
 IX_AB044D1C=OrgGroupRole.RoleId
512 506
 
@@ -525,9 +519,6 @@ IX_CD25266E=PasswordPolicyRel.PasswordPolicyId
525 519
 
526 520
 IX_326F75BD=PasswordTracker.UserId
527 521
 
528  
-IX_4D19C2B8=Permission_.A_R
529  
-IX_F090C113=Permission_.ResourceId
530  
-
531 522
 IX_A2E4AFBA=Phone.C_C
532 523
 IX_9A53569=Phone.C_C_C
533 524
 IX_812CE07A=Phone.C_C_C_P
@@ -596,10 +587,6 @@ IX_2D4CC782=ResourceBlock.C_N
596 587
 IX_D63D20BB=ResourceBlockPermission.R_R
597 588
 IX_4AB3756=ResourceBlockPermission.ResourceBlockId
598 589
 
599  
-IX_A32C097E=ResourceCode.C_N_S
600  
-IX_717FDD47=ResourceCode.CompanyId
601  
-IX_AACAFF40=ResourceCode.Name
602  
-
603 590
 IX_88705859=ResourcePermission.C_N_P_O
604 591
 IX_C94C7708=ResourcePermission.C_N_P_R_A
605 592
 IX_60B99860=ResourcePermission.C_N_S
@@ -615,9 +602,6 @@ IX_BA497163=ResourceTypePermission.C_G_N_R
615 602
 IX_7D81F66F=ResourceTypePermission.C_N_R
616 603
 IX_A82690E2=ResourceTypePermission.RoleId
617 604
 
618  
-IX_67DE7856=Resource_.C_P
619  
-IX_2578FBD3=Resource_.CodeId
620  
-
621 605
 IX_A88E424E=Role_.C_C_C
622 606
 IX_EBC931B8=Role_.C_N
623 607
 IX_449A10B9=Role_.CompanyId
@@ -625,9 +609,6 @@ IX_F436EC8E=Role_.Name
625 609
 IX_5EB4E2FB=Role_.Subtype
626 610
 IX_CBE204=Role_.T_S
627 611
 
628  
-IX_7A3619C6=Roles_Permissions.permissionId
629  
-IX_E04E486D=Roles_Permissions.roleId
630  
-
631 612
 IX_3BB93ECA=SCFrameworkVersi_SCProductVers.frameworkVersionId
632 613
 IX_E8D33FF9=SCFrameworkVersi_SCProductVers.productVersionId
633 614
 
@@ -802,9 +783,6 @@ IX_F10B6C6B=Users_Groups.userId
802 783
 IX_7EF4EC0E=Users_Orgs.organizationId
803 784
 IX_FB646CA6=Users_Orgs.userId
804 785
 
805  
-IX_8AE58A91=Users_Permissions.permissionId
806  
-IX_C26AA64D=Users_Permissions.userId
807  
-
808 786
 IX_C19E5F31=Users_Roles.roleId
809 787
 IX_C1A01806=Users_Roles.userId
810 788
 
22  sql/indexes.sql
@@ -279,9 +279,6 @@ create index IX_7B590A7A on Group_ (type_, active_);
279 279
 create index IX_75267DCA on Groups_Orgs (groupId);
280 280
 create index IX_6BBB7682 on Groups_Orgs (organizationId);
281 281
 
282  
-create index IX_C48736B on Groups_Permissions (groupId);
283  
-create index IX_EC97689D on Groups_Permissions (permissionId);
284  
-
285 282
 create index IX_84471FD2 on Groups_Roles (groupId);
286 283
 create index IX_3103EF3D on Groups_Roles (roleId);
287 284
 
@@ -497,9 +494,6 @@ create index IX_C28C72EC on MembershipRequest (groupId, statusId);
497 494
 create index IX_35AA8FA6 on MembershipRequest (groupId, userId, statusId);
498 495
 create index IX_66D70879 on MembershipRequest (userId);
499 496
 
500  
-create index IX_A425F71A on OrgGroupPermission (groupId);
501  
-create index IX_6C53DA4E on OrgGroupPermission (permissionId);
502  
-
503 497
 create index IX_4A527DD3 on OrgGroupRole (groupId);
504 498
 create index IX_AB044D1C on OrgGroupRole (roleId);
505 499
 
@@ -518,9 +512,6 @@ create index IX_ED7CF243 on PasswordPolicyRel (passwordPolicyId, classNameId, cl
518 512
 
519 513
 create index IX_326F75BD on PasswordTracker (userId);
520 514
 
521  
-create unique index IX_4D19C2B8 on Permission_ (actionId, resourceId);
522  
-create index IX_F090C113 on Permission_ (resourceId);
523  
-
524 515
 create index IX_9F704A14 on Phone (companyId);
525 516
 create index IX_A2E4AFBA on Phone (companyId, classNameId);
526 517
 create index IX_9A53569 on Phone (companyId, classNameId, classPK);
@@ -592,10 +583,6 @@ create index IX_2D4CC782 on ResourceBlock (companyId, name);
592 583
 create index IX_4AB3756 on ResourceBlockPermission (resourceBlockId);
593 584
 create unique index IX_D63D20BB on ResourceBlockPermission (resourceBlockId, roleId);
594 585
 
595  
-create index IX_717FDD47 on ResourceCode (companyId);
596  
-create unique index IX_A32C097E on ResourceCode (companyId, name, scope);
597  
-create index IX_AACAFF40 on ResourceCode (name);
598  
-
599 586
 create index IX_88705859 on ResourcePermission (companyId, name, primKey, ownerId);
600 587
 create index IX_C94C7708 on ResourcePermission (companyId, name, primKey, roleId, actionIds);
601 588
 create index IX_60B99860 on ResourcePermission (companyId, name, scope);
@@ -611,9 +598,6 @@ create unique index IX_BA497163 on ResourceTypePermission (companyId, groupId, n
611 598
 create index IX_7D81F66F on ResourceTypePermission (companyId, name, roleId);
612 599
 create index IX_A82690E2 on ResourceTypePermission (roleId);
613 600
 
614  
-create index IX_2578FBD3 on Resource_ (codeId);
615  
-create unique index IX_67DE7856 on Resource_ (codeId, primKey);
616  
-
617 601
 create index IX_449A10B9 on Role_ (companyId);
618 602
 create unique index IX_A88E424E on Role_ (companyId, classNameId, classPK);
619 603
 create unique index IX_EBC931B8 on Role_ (companyId, name);
@@ -621,9 +605,6 @@ create index IX_F436EC8E on Role_ (name);
621 605
 create index IX_5EB4E2FB on Role_ (subtype);
622 606
 create index IX_CBE204 on Role_ (type_, subtype);
623 607
 
624  
-create index IX_7A3619C6 on Roles_Permissions (permissionId);
625  
-create index IX_E04E486D on Roles_Permissions (roleId);
626  
-
627 608
 create index IX_3BB93ECA on SCFrameworkVersi_SCProductVers (frameworkVersionId);
628 609
 create index IX_E8D33FF9 on SCFrameworkVersi_SCProductVers (productVersionId);
629 610
 
@@ -797,9 +778,6 @@ create index IX_F10B6C6B on Users_Groups (userId);
797 778
 create index IX_7EF4EC0E on Users_Orgs (organizationId);
798 779
 create index IX_FB646CA6 on Users_Orgs (userId);
799 780
 
800  
-create index IX_8AE58A91 on Users_Permissions (permissionId);
801  
-create index IX_C26AA64D on Users_Permissions (userId);
802  
-
803 781
 create index IX_C19E5F31 on Users_Roles (roleId);
804 782
 create index IX_C1A01806 on Users_Roles (userId);
805 783
 
45  sql/portal-tables.sql
@@ -745,12 +745,6 @@ create table Groups_Orgs (
745 745
 	primary key (groupId, organizationId)
746 746
 );
747 747
 
748  
-create table Groups_Permissions (
749  
-	groupId LONG not null,
750  
-	permissionId LONG not null,
751  
-	primary key (groupId, permissionId)
752  
-);
753  
-
754 748
 create table Groups_Roles (
755 749
 	groupId LONG not null,
756 750
 	roleId LONG not null,
@@ -1281,13 +1275,6 @@ create table Organization_ (
1281 1275
 	comments STRING null
1282 1276
 );
1283 1277
 
1284  
-create table OrgGroupPermission (
1285  
-	organizationId LONG not null,
1286  
-	groupId LONG not null,
1287  
-	permissionId LONG not null,
1288  
-	primary key (organizationId, groupId, permissionId)
1289  
-);
1290  
-
1291 1278
 create table OrgGroupRole (
1292 1279
 	organizationId LONG not null,
1293 1280
 	groupId LONG not null,
@@ -1364,13 +1351,6 @@ create table PasswordTracker (
1364 1351
 	password_ VARCHAR(75) null
1365 1352
 );
1366 1353
 
1367  
-create table Permission_ (
1368  
-	permissionId LONG not null primary key,
1369  
-	companyId LONG,
1370  
-	actionId VARCHAR(75) null,
1371  
-	resourceId LONG
1372  
-);
1373  
-
1374 1354
 create table Phone (
1375 1355
 	phoneId LONG not null primary key,
1376 1356
 	companyId LONG,
@@ -1558,12 +1538,6 @@ create table ResourceTypePermission (
1558 1538
 	actionIds LONG
1559 1539
 );
1560 1540
 
1561  
-create table Resource_ (
1562  
-	resourceId LONG not null primary key,
1563  
-	codeId LONG,
1564  
-	primKey VARCHAR(255) null
1565  
-);
1566  
-
1567 1541
 create table ResourceAction (
1568 1542
 	resourceActionId LONG not null primary key,
1569 1543
 	name VARCHAR(255) null,
@@ -1571,13 +1545,6 @@ create table ResourceAction (
1571 1545
 	bitwiseValue LONG
1572 1546
 );
1573 1547
 
1574  
-create table ResourceCode (
1575  
-	codeId LONG not null primary key,
1576  
-	companyId LONG,
1577  
-	name VARCHAR(255) null,
1578  
-	scope INTEGER
1579  
-);
1580  
-
1581 1548
 create table ResourcePermission (
1582 1549
 	resourcePermissionId LONG not null primary key,
1583 1550
 	companyId LONG,
@@ -1601,12 +1568,6 @@ create table Role_ (
1601 1568
 	subtype VARCHAR(75) null
1602 1569
 );
1603 1570
 
1604  
-create table Roles_Permissions (
1605  
-	roleId LONG not null,
1606  
-	permissionId LONG not null,
1607  
-	primary key (roleId, permissionId)
1608  
-);
1609  
-
1610 1571
 create table SCFrameworkVersi_SCProductVers (
1611 1572
 	frameworkVersionId LONG not null,
1612 1573
 	productVersionId LONG not null,
@@ -2100,12 +2061,6 @@ create table Users_Orgs (
2100 2061
 	primary key (userId, organizationId)
2101 2062
 );
2102 2063
 
2103  
-create table Users_Permissions (
2104  
-	userId LONG not null,
2105  
-	permissionId LONG not null,
2106  
-	primary key (userId, permissionId)
2107  
-);
2108  
-
2109 2064
 create table Users_Roles (
2110 2065
 	userId LONG not null,
2111 2066
 	roleId LONG not null,
9  sql/update-6.1.0-6.2.0.sql
... ...
@@ -0,0 +1,9 @@
  1
+drop table Groups_Permissions;
  2
+drop table OrgGroupPermission;
  3
+drop table Permission_;
  4
+drop table Resource_;
  5
+drop table ResourceCode;
  6
+drop table Roles_Permissions;
  7
+drop table Users_Permissions;
  8
+
  9
+COMMIT_TRANSACTION;
9  sql/update-6.1.1-6.2.0.sql
... ...
@@ -0,0 +1,9 @@
  1
+drop table Groups_Permissions;
  2
+drop table OrgGroupPermission;
  3
+drop table Permission_;
  4
+drop table Resource_;
  5
+drop table ResourceCode;
  6
+drop table Roles_Permissions;
  7
+drop table Users_Permissions;
  8
+
  9
+COMMIT_TRANSACTION;

0 notes on commit 1afa11f

Please sign in to comment.
Something went wrong with that request. Please try again.