Skip to content

Commit

Permalink
SAK-33430 use a proper index on site_id because queries are against s…
Browse files Browse the repository at this point in the history
…ite_id (sakaiproject#4871)
  • Loading branch information
ottenhoff authored Oct 9, 2017
1 parent 7a2c1df commit 1fff994
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions userauditservice/impl/src/sql/hsqldb/user_audits.sql
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
-- SAK-23634 - new table to track user add/drop/update actions done in sites
CREATE TABLE user_audits_log (
id bigint generated by default as identity (start with 1),
site_id VARCHAR(255) NOT NULL,
site_id VARCHAR(99) NOT NULL,
user_id VARCHAR(99) NOT NULL,
role_name VARCHAR(255) NOT NULL,
role_name VARCHAR(99) NOT NULL,
action_taken VARCHAR(1) NOT NULL,
audit_stamp TIMESTAMP NOT NULL,
source VARCHAR(1),
action_user_id VARCHAR(99),
PRIMARY KEY(id)
);
);
6 changes: 3 additions & 3 deletions userauditservice/impl/src/sql/mysql/user_audits.sql
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
-- SAK-23634 - new table to track user add/drop/update actions done in sites
CREATE TABLE user_audits_log (
id BIGINT AUTO_INCREMENT NOT NULL,
site_id VARCHAR(255) NOT NULL,
site_id VARCHAR(99) NOT NULL,
user_id VARCHAR(99) NOT NULL,
role_name VARCHAR(255) NOT NULL,
role_name VARCHAR(99) NOT NULL,
action_taken VARCHAR(1) NOT NULL,
audit_stamp TIMESTAMP NOT NULL,
source VARCHAR(1),
action_user_id VARCHAR(99),
PRIMARY KEY(id)
);

CREATE INDEX user_audits_log_index ON user_audits_log (id,site_id);
CREATE INDEX user_audits_log_index ON user_audits_log (site_id);
8 changes: 4 additions & 4 deletions userauditservice/impl/src/sql/oracle/user_audits.sql
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
-- SAK-23634 - new table to track user add/drop/update actions done in sites
CREATE TABLE user_audits_log (
id NUMBER(19,0) NOT NULL,
site_id VARCHAR2(255) NOT NULL,
site_id VARCHAR2(99) NOT NULL,
user_id VARCHAR2(99) NOT NULL,
role_name VARCHAR2(255) NOT NULL,
role_name VARCHAR2(99) NOT NULL,
action_taken VARCHAR2(1) NOT NULL,
audit_stamp TIMESTAMP NOT NULL,
source VARCHAR2(1),
action_user_id VARCHAR2(99),
PRIMARY KEY(id)
);

CREATE INDEX user_audits_log_index ON user_audits_log (id,site_id);
CREATE INDEX user_audits_log_index ON user_audits_log (site_id);

CREATE SEQUENCE user_audits_log_seq;
CREATE SEQUENCE user_audits_log_seq;

0 comments on commit 1fff994

Please sign in to comment.