diff --git a/config/alfresco/audit/alfresco-audit-repository.xml b/config/alfresco/audit/alfresco-audit-repository.xml
index 40e7f3311c..955a7e7c3b 100644
--- a/config/alfresco/audit/alfresco-audit-repository.xml
+++ b/config/alfresco/audit/alfresco-audit-repository.xml
@@ -17,14 +17,10 @@
-
-
-
-
@@ -49,4 +45,4 @@
-
\ No newline at end of file
+
diff --git a/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-AuditTables.sql b/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-AuditTables.sql
index 712696ccd5..4795de2da9 100644
--- a/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-AuditTables.sql
+++ b/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-AuditTables.sql
@@ -27,6 +27,20 @@ CREATE TABLE alf_audit_session
PRIMARY KEY (id)
) ENGINE=InnoDB;
+CREATE TABLE alf_audit_entry
+(
+ id BIGINT NOT NULL AUTO_INCREMENT,
+ audit_session_id BIGINT NOT NULL,
+ audit_time BIGINT NOT NULL,
+ audit_user_id BIGINT NULL,
+ audit_values_id BIGINT NOT NULL,
+ CONSTRAINT fk_alf_audit_ent_sess FOREIGN KEY (audit_session_id) REFERENCES alf_audit_session (id),
+ INDEX idx_alf_audit_ent_time (audit_time),
+ CONSTRAINT fk_alf_audit_ent_user FOREIGN KEY (audit_user_id) REFERENCES alf_prop_value (id),
+ CONSTRAINT fk_alf_audit_ent_prop FOREIGN KEY (audit_values_id) REFERENCES alf_prop_value (id),
+ PRIMARY KEY (id)
+) ENGINE=InnoDB;
+
--
-- Record script finish
--
diff --git a/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-PropertyValueTables.sql b/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-PropertyValueTables.sql
index f09c67d2d7..f23442cd8e 100644
--- a/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-PropertyValueTables.sql
+++ b/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-PropertyValueTables.sql
@@ -46,9 +46,10 @@ CREATE TABLE alf_prop_string_value
(
id BIGINT NOT NULL AUTO_INCREMENT,
string_value TEXT NOT NULL,
- string_end VARCHAR(16) NOT NULL,
- INDEX idx_alf_prop_str_start (string_value(32)),
- INDEX idx_alf_prop_str_end (string_end),
+ string_end_lower VARCHAR(16) NOT NULL,
+ string_crc BIGINT NOT NULL,
+ INDEX idx_alf_prop_str (string_value(32)),
+ INDEX idx_alf_prop_crc (string_end_lower, string_crc),
PRIMARY KEY (id)
) ENGINE=InnoDB;
diff --git a/config/alfresco/ibatis/org.hibernate.dialect.Dialect/audit-common-SqlMap.xml b/config/alfresco/ibatis/org.hibernate.dialect.Dialect/audit-common-SqlMap.xml
index aa7ebcd557..ddfac2d6f4 100644
--- a/config/alfresco/ibatis/org.hibernate.dialect.Dialect/audit-common-SqlMap.xml
+++ b/config/alfresco/ibatis/org.hibernate.dialect.Dialect/audit-common-SqlMap.xml
@@ -12,6 +12,7 @@
+
@@ -27,6 +28,13 @@
+
+
+
+
+
+
+
@@ -50,6 +58,11 @@
values (#auditModelId#, #applicationNameId#)
+
+ insert into alf_audit_entry (audit_session_id, audit_user_id, audit_time, audit_values_id)
+ values (#auditSessionId#, #auditUserId#, #auditTime#, #auditValuesId#)
+
+
diff --git a/config/alfresco/ibatis/org.hibernate.dialect.Dialect/propval-common-SqlMap.xml b/config/alfresco/ibatis/org.hibernate.dialect.Dialect/propval-common-SqlMap.xml
index 4b40761679..234f3ad293 100644
--- a/config/alfresco/ibatis/org.hibernate.dialect.Dialect/propval-common-SqlMap.xml
+++ b/config/alfresco/ibatis/org.hibernate.dialect.Dialect/propval-common-SqlMap.xml
@@ -44,7 +44,8 @@
-
+
+
@@ -92,8 +93,8 @@
- insert into alf_prop_string_value (string_value, string_end)
- values (#stringValue#, #stringEnd#)
+ insert into alf_prop_string_value (string_value, string_end_lower, string_crc)
+ values (#stringValue#, #stringEndLower#, #stringCrc#)
@@ -180,32 +181,16 @@
id = #id#
-
-