Skip to content

Commit

Permalink
Revert "add indexes+extension"
Browse files Browse the repository at this point in the history
This reverts commit 972763e.
  • Loading branch information
clauyan committed Nov 29, 2024
1 parent a0082d2 commit 48e5b17
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 156 deletions.
84 changes: 0 additions & 84 deletions migrations/.snapshot-dbildungs-iam-server.json
Original file line number Diff line number Diff line change
Expand Up @@ -2052,50 +2052,6 @@
"unique": false,
"expression": "create unique index \"person_keycloak_user_id_unique\" on \"person\" (\"keycloak_user_id\") nulls not distinct;"
},
{
"keyName": "person_referrer_trgm_index",
"columnNames": [
"referrer"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false,
"expression": "create index \"person_referrer_trgm_index\" on \"person\" using gin (\"referrer\" gin_trgm_ops);"
},
{
"keyName": "person_familienname_trgm_index",
"columnNames": [
"familienname"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false,
"expression": "create index \"person_familienname_trgm_index\" on \"person\" using gin (\"familienname\" gin_trgm_ops);"
},
{
"keyName": "person_vorname_trgm_index",
"columnNames": [
"vorname"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false,
"expression": "create index \"person_vorname_trgm_index\" on \"person\" using gin (\"vorname\" gin_trgm_ops);"
},
{
"keyName": "person_personalnummer_trgm_index",
"columnNames": [
"personalnummer"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false,
"expression": "create index \"person_personalnummer_trgm_index\" on \"person\" using gin (\"personalnummer\" gin_trgm_ops);"
},
{
"keyName": "person_personalnummer_unique",
"columnNames": [
Expand Down Expand Up @@ -2389,16 +2345,6 @@
"primary": false,
"unique": true
},
{
"columnNames": [
"person_id"
],
"composite": false,
"keyName": "email_address_person_id_index",
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "email_address_pkey",
"columnNames": [
Expand Down Expand Up @@ -3030,16 +2976,6 @@
"primary": false,
"unique": false
},
{
"columnNames": [
"organisation_id"
],
"composite": false,
"keyName": "personenkontext_organisation_id_index",
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "personenkontext_person_id_organisation_id_rolle_id_unique",
"columnNames": [
Expand Down Expand Up @@ -3286,16 +3222,6 @@
"name": "rolle_merkmal",
"schema": "public",
"indexes": [
{
"columnNames": [
"rolle_id"
],
"composite": false,
"keyName": "rolle_merkmal_rolle_id_index",
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "rolle_merkmal_pkey",
"columnNames": [
Expand Down Expand Up @@ -3528,16 +3454,6 @@
"name": "rolle_systemrecht",
"schema": "public",
"indexes": [
{
"columnNames": [
"rolle_id"
],
"composite": false,
"keyName": "rolle_systemrecht_rolle_id_index",
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "rolle_systemrecht_pkey",
"columnNames": [
Expand Down
41 changes: 0 additions & 41 deletions migrations/Migration20241127092339-S.ts

This file was deleted.

5 changes: 1 addition & 4 deletions src/modules/email/persistence/email-address.entity.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Entity, Enum, Index, ManyToOne, Property, Ref } from '@mikro-orm/core';
import { Entity, Enum, ManyToOne, Property, Ref } from '@mikro-orm/core';
import { PersonEntity } from '../../person/persistence/person.entity.js';
import { TimestampedEntity } from '../../../persistence/timestamped.entity.js';
import { EmailAddressStatus } from '../domain/email-address.js';
Expand All @@ -13,9 +13,6 @@ export class EmailAddressEntity extends TimestampedEntity {
deleteRule: 'set null',
entity: () => PersonEntity,
})
@Index({
name: 'email_address_person_id_index',
})
public personId!: Ref<PersonEntity>;

@Property({ primary: true, nullable: false, unique: true })
Expand Down
18 changes: 0 additions & 18 deletions src/modules/person/persistence/person.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ export class PersonEntity extends TimestampedEntity {
public keycloakUserId!: string;

@AutoMap()
@Index({
name: 'person_referrer_trgm_index',
expression: 'create index "person_referrer_trgm_index" on "person" using gin ("referrer" gin_trgm_ops);',
})
@Property({ nullable: true })
public referrer?: string;

Expand All @@ -54,19 +50,10 @@ export class PersonEntity extends TimestampedEntity {
public readonly stammorganisation?: string;

@AutoMap()
@Index({
name: 'person_familienname_trgm_index',
expression:
'create index "person_familienname_trgm_index" on "person" using gin ("familienname" gin_trgm_ops);',
})
@Property()
public familienname!: string;

@AutoMap()
@Index({
name: 'person_vorname_trgm_index',
expression: 'create index "person_vorname_trgm_index" on "person" using gin ("vorname" gin_trgm_ops);',
})
@Property()
public vorname!: string;

Expand Down Expand Up @@ -138,11 +125,6 @@ export class PersonEntity extends TimestampedEntity {
name: 'person_personalnummer_unique',
expression: 'create unique index "person_personalnummer_unique" on "person" ("personalnummer") nulls distinct;',
})
@Index({
name: 'person_personalnummer_trgm_index',
expression:
'create index "person_personalnummer_trgm_index" on "person" using gin ("personalnummer" gin_trgm_ops);',
})
@Property({ nullable: true })
public personalnummer?: string;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export class PersonenkontextEntity extends TimestampedEntity {
// TODO EW-636: get from access_token, see SchulConneX (Version 1.003.003.000) page 91
@AutoMap()
@Property({ columnType: 'uuid', nullable: true })
@Index({ name: 'personenkontext_organisation_id_index' })
public organisationId!: string;

@ManyToOne({
Expand Down
5 changes: 1 addition & 4 deletions src/modules/rolle/entity/rolle-merkmal.entity.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { BaseEntity, Entity, Enum, Index, ManyToOne, PrimaryKeyProp, Rel } from '@mikro-orm/core';
import { BaseEntity, Entity, Enum, ManyToOne, PrimaryKeyProp, Rel } from '@mikro-orm/core';
import { RollenMerkmal } from '../domain/rolle.enums.js';
import { RolleEntity } from './rolle.entity.js';

@Entity({ tableName: 'rolle_merkmal' })
export class RolleMerkmalEntity extends BaseEntity {
@ManyToOne({ primary: true, entity: () => RolleEntity })
@Index({
name: 'rolle_merkmal_rolle_id_index',
})
public rolle!: Rel<RolleEntity>;

@Enum({ primary: true, items: () => RollenMerkmal, nativeEnumName: 'rollen_merkmal_enum' })
Expand Down
5 changes: 1 addition & 4 deletions src/modules/rolle/entity/rolle-systemrecht.entity.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { BaseEntity, Entity, Enum, Index, ManyToOne, PrimaryKeyProp, Rel } from '@mikro-orm/core';
import { BaseEntity, Entity, Enum, ManyToOne, PrimaryKeyProp, Rel } from '@mikro-orm/core';
import { RolleEntity } from './rolle.entity.js';
import { RollenSystemRecht } from '../domain/rolle.enums.js';

@Entity({ tableName: 'rolle_systemrecht' })
export class RolleSystemrechtEntity extends BaseEntity {
@ManyToOne({ primary: true, entity: () => RolleEntity })
@Index({
name: 'rolle_systemrecht_rolle_id_index',
})
public rolle!: Rel<RolleEntity>;

@Enum({ primary: true, items: () => RollenSystemRecht, nativeEnumName: 'rollen_system_recht_enum' })
Expand Down

0 comments on commit 48e5b17

Please sign in to comment.