View Issue Details

IDProjectCategoryView StatusLast Update
0001363Database Workbench v6Meta Data Compare & Migrationpublic2022-01-12 11:52
ReporterJeroen Pluimers Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformFirebirdOSanyOS Versionany
Product Version5.1.12 
Summary0001363: Schema Compare gives wrong SQL script for changes missing
DescriptionSource Tables:

CREATE TABLE MONITORINGEVENT
(
  ID INTEGER NOT NULL,
  SERVERID INTEGER NOT NULL,
  DATETIME TIMESTAMP NOT NULL,
  STATUSID INTEGER NOT NULL,
  CLASS CHAR( 4) NOT NULL COLLATE NONE,
  CUSTOMDATA VARCHAR( 40) NOT NULL COLLATE NONE,
  TICKCOUNT INTEGER,
  ISUNIQUE VARCHAR( 1) COLLATE NONE,
 CONSTRAINT PK_MONITORINGEVENT PRIMARY KEY (ID, SERVERID)
);

CREATE TABLE MONITORINGSTATUS
(
  ID INTEGER NOT NULL,
  SERVERID INTEGER NOT NULL,
  CLASSDESCRIPTION VARCHAR( 25) NOT NULL COLLATE NONE,
  STATUSLEVEL INTEGER NOT NULL,
  SENSORID INTEGER,
  SENSORSTRING VARCHAR( 100) COLLATE NONE,
  LOCATIONID INTEGER,
  LOCATIONSTRING VARCHAR( 100) COLLATE NONE,
  ENDPOINTID INTEGER,
  ENDPOINTSTRING VARCHAR( 100) COLLATE NONE,
  HQSTRING VARCHAR( 250) COLLATE NONE,
  STARTDATE TIMESTAMP,
  RESOLVEDATE TIMESTAMP,
  LASTUPDATE TIMESTAMP,
  URGENTDATE TIMESTAMP,
  NORMALDATE TIMESTAMP,
  LOWDATE TIMESTAMP,
  LOG BLOB SUB_TYPE 1 SEGMENT SIZE 4096,
  TICKCOUNT INTEGER,
  MONITORINGSTATE INTEGER,
  MONITORINGSTATEUNTIL TIMESTAMP,
 CONSTRAINT PK_MONITORINGSTATUS PRIMARY KEY (ID, SERVERID)
);


Destination Tables:

CREATE TABLE MONITORINGEVENT
(
  ID INTEGER NOT NULL,
  SERVERID INTEGER NOT NULL,
  DATETIME TIMESTAMP NOT NULL,
  STATUSID INTEGER NOT NULL,
  CLASS CHAR( 4) NOT NULL COLLATE NONE,
  CUSTOMDATA VARCHAR( 40) NOT NULL COLLATE NONE,
  TICKCOUNT INTEGER,
  ISUNIQUE VARCHAR( 1) COLLATE NONE,
 CONSTRAINT PK_MONITORINGEVENT PRIMARY KEY (ID)
);

CREATE TABLE MONITORINGSTATUS
(
  ID INTEGER NOT NULL,
  SERVERID INTEGER NOT NULL,
  CLASSDESCRIPTION VARCHAR( 25) NOT NULL COLLATE NONE,
  STATUSLEVEL INTEGER NOT NULL,
  SENSORID INTEGER,
  SENSORSTRING VARCHAR( 100) COLLATE NONE,
  LOCATIONID INTEGER,
  LOCATIONSTRING VARCHAR( 100) COLLATE NONE,
  ENDPOINTID INTEGER,
  ENDPOINTSTRING VARCHAR( 100) COLLATE NONE,
  HQSTRING VARCHAR( 250) COLLATE NONE,
  STARTDATE TIMESTAMP,
  RESOLVEDATE TIMESTAMP,
  LASTUPDATE TIMESTAMP,
  URGENTDATE TIMESTAMP,
  NORMALDATE TIMESTAMP,
  LOWDATE TIMESTAMP,
  LOG BLOB SUB_TYPE 1 SEGMENT SIZE 4096,
  TICKCOUNT INTEGER,
  MONITORINGSTATE INTEGER,
  MONITORINGSTATEUNTIL TIMESTAMP,
 CONSTRAINT PK_MONITORINGSTATUS PRIMARY KEY (ID)
);

Source constraint missing in destination:

ALTER TABLE MONITORINGEVENT ADD CONSTRAINT FK_MONITORINGEVENT_STATUS
  FOREIGN KEY (STATUSID, SERVERID) REFERENCES MONITORINGSTATUS
  (ID, SERVERID)
  ON DELETE NO ACTION
  ON UPDATE NO ACTION
;


Update script:

ALTER TABLE MONITORINGEVENT ADD CONSTRAINT FK_MONITORINGEVENT_STATUS
  FOREIGN KEY (STATUSID, SERVERID) REFERENCES MONITORINGSTATUS
  (ID, SERVERID)
  ON DELETE NO ACTION
  ON UPDATE NO ACTION
;

Fails probably caused by http://tracker.upscene.com/view.php?id=1362

---------------------------
Error
---------------------------
Script Error:

unsuccessful metadata update
could not find UNIQUE or PRIMARY KEY constraint in table MONITORINGSTATUS with specified columns

---------------------------
Abort Ignore
---------------------------
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2016-04-20 07:55 Jeroen Pluimers New Issue
2022-01-12 11:52 Martijn Tonies Project Database Workbench v5 => Database Workbench v6