Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Soft deletion and unique index in "proc_model" and "stencil_set" when MySQL is used #24

Open
haulmont-git opened this issue Nov 1, 2017 · 0 comments
Assignees
Labels
type: bug Something isn't working

Comments

@haulmont-git
Copy link

  1. Create a project on MySQL
  2. Enable BPM
  3. Start the server
  4. Create several models with the same name
    Able to create several models with the same name. But model name should be unique?
    !image.png!

On MySQL the additional "delete_ts_nn" is added and unique is created with trigger

create unique index IDX_REPORT_REPORT_UNIQ_NAME on REPORT_REPORT (NAME, DELETE_TS_NN)^

create trigger REPORT_REPORT_DELETE_TS_NN_TRIGGER before update on REPORT_REPORT
  for each row
    if not(NEW.DELETE_TS <=> OLD.DELETE_TS) then
      set NEW.DELETE_TS_NN = if (NEW.DELETE_TS is null, '1000-01-01 00:00:00.000', NEW.DELETE_TS);
    end if^

But the following scripts found:

create unique index IDX_BPM_PROC_MODEL_UNIQ_NAME on BPM_PROC_MODEL (NAME, DELETE_TS)^
-- end BPM_PROC_MODEL
-- begin BPM_STENCIL_SET
create unique index IDX_BPM_STENCIL_SET_UNIQ_NAME on BPM_STENCIL_SET (NAME, DELETE_TS) ^
-- end BPM_STENCIL_SET
create table BPM_PROC_MODEL (
    ID varchar(32),
    CREATE_TS datetime(3),
    CREATED_BY varchar(50),
    VERSION integer,
    UPDATE_TS datetime(3),
    UPDATED_BY varchar(50),
    DELETE_TS datetime(3),
    DELETED_BY varchar(50),
    --
    NAME varchar(190) not null,
    ACT_MODEL_ID varchar(255),
    DESCRIPTION text,
    --
    primary key (ID)
)^
-- end BPM_PROC_MODEL
-- begin BPM_STENCIL_SET
create table BPM_STENCIL_SET (
    ID varchar(32),
    CREATE_TS datetime(3),
    CREATED_BY varchar(50),
    VERSION integer,
    UPDATE_TS datetime(3),
    UPDATED_BY varchar(50),
    DELETE_TS datetime(3),
    DELETED_BY varchar(50),
    --
    NAME varchar(190) not null,
    JSON_DATA longtext not null,
    --
    primary key (ID)
)^

Original issue: https://youtrack.haulmont.com/issue/PL-9954

@haulmont-git haulmont-git added bpm type: bug Something isn't working labels Apr 27, 2018
@haulmont-git haulmont-git added this to the Undefined milestone Apr 27, 2018
@rapekas rapekas removed the bpm label Apr 28, 2018
@jreznot jreznot removed this from the Undefined milestone May 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants