Skip to content

Commit

Permalink
Refactorings
Browse files Browse the repository at this point in the history
- shorten the index name. similar name pattern then existing idexes
- changed order of index. indentity_zone_id should be always first column
- removed not null from SQL, since not needed, see https://stackoverflow.com/questions/8660203/how-to-check-for-is-not-null-and-is-not-empty-string-in-sql-server
or
https://stackoverflow.com/questions/1106258/mysql-null-vs
  • Loading branch information
strehle committed Jun 26, 2024
1 parent 28f0b8f commit 412aa11
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class JdbcIdentityProviderProvisioning implements IdentityProviderProvisi

public static final String IDENTITY_ACTIVE_PROVIDERS_QUERY = IDENTITY_PROVIDERS_QUERY + " and active=?";

public static final String IDP_WITH_ALIAS_EXISTS_QUERY = "select 1 from identity_provider idp where idp.identity_zone_id = ? and idp.alias_zid is not null and idp.alias_zid <> '' limit 1";
public static final String IDP_WITH_ALIAS_EXISTS_QUERY = "select 1 from identity_provider idp where idp.identity_zone_id = ? and idp.alias_zid <> '' limit 1";

public static final String ID_PROVIDER_UPDATE_FIELDS = "version,lastmodified,name,type,config,active,alias_id,alias_zid".replace(",", "=?,") + "=?";

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CREATE INDEX IF NOT EXISTS identity_provider_alias_zid_idz_id__idx on identity_provider (alias_zid, identity_zone_id);
CREATE INDEX IF NOT EXISTS alias_in_zone on identity_provider (identity_zone_id, alias_zid);
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CREATE INDEX identity_provider_alias_zid_idz_id__idx on identity_provider (alias_zid, identity_zone_id) LOCK = SHARED;
CREATE INDEX alias_in_zone on identity_provider (identity_zone_id, alias_zid) LOCK = SHARED;
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CREATE INDEX CONCURRENTLY IF NOT EXISTS identity_provider_alias_zid_idz_id__idx on identity_provider (alias_zid, identity_zone_id);
CREATE INDEX CONCURRENTLY IF NOT EXISTS alias_in_zone on identity_provider (identity_zone_id, alias_zid) WHERE alias_zid IS NOT NULL;

0 comments on commit 412aa11

Please sign in to comment.