cuba-platform / reports

CUBA Reports Addon
https://www.cuba-platform.com/
Apache License 2.0
9 stars 4 forks source link

Migration problem with dropping unexisted indexes #289

Closed SevDan closed 3 years ago

SevDan commented 3 years ago

Environment

Description of the bug or enhancement

Preconditions: Old application with 7.1.7 CUBA and reports version (i.e. sample-timesheets)

Steps:

  1. Migrate application to 7.2.13 from 7.1.7
  2. Run application with database scripts execution ER: Successfully migration AR: Exception with '191223-addSysTenantIdForReportEntities.sql' because has no 'IDX_REPORT_GROUP_UNIQ_TITLE' index
SevDan commented 3 years ago

It seems may be solved with if exists for some rdbms (PostgreSQL, Oracle, mssql): drop index if exists IDX_REPORT_GROUP_UNIQ_TITLE on REPORT_GROUP^

Desire456 commented 3 years ago

Can't reproduce the issue. There is index creation in the generated script from reports addon 7.1.7 version:

create table REPORT_GROUP (
  ID uuid not null,
  CREATE_TS timestamp,
  CREATED_BY varchar(50),
  VERSION integer,
  UPDATE_TS timestamp,
  UPDATED_BY varchar(50),
  DELETE_TS timestamp,
  DELETED_BY varchar(50),
  --
  TITLE varchar(255) not null,
  CODE varchar(255),
  LOCALE_NAMES text,
  --
  primary key (ID)
)^

create unique index IDX_REPORT_GROUP_UNIQ_TITLE on REPORT_GROUP (TITLE) where DELETE_TS is null^

--------------------------------------------------------------------------------------------------------------