During startup of my xData/Aurelius rest server I do a TDatabaseManager.ValidateDatabase.
I used to get a lot of errors/warning/actions, but reading the documentation and especially this: Data Modeler and Aurelius compatibility, I understood and was able to get rid of most of them. I am though, still left with 12 errors, 3 Warning and 3 Actions.
My question is about the Warnings and Actions.
The 3 Warnings and 3 Actions:
[11/30/2022 2:30:32 PM][Info] Warning: Foreign key: ItemPlug.FK_ItemPlug_Product_ProductID - Created. Existing data might be incompatible.
[11/30/2022 2:30:32 PM][Info] Warning: Foreign key: ItemCtrl.FK_ItemCtrl_Product_ProductID - Created. Existing data might be incompatible.
[11/30/2022 2:30:32 PM][Info] Warning: Foreign key: ItemModem.FK_ItemModem_Product_ProductID - Created. Existing data might be incompatible.
[11/30/2022 2:30:32 PM][Info] Action: Foreign key: dbo.ItemPlug.FK_ItemPlug_Product - Removed.
[11/30/2022 2:30:32 PM][Info] Action: Foreign key: dbo.ItemCtrl.FK_Product_ItemCtrl - Removed.
[11/30/2022 2:30:32 PM][Info] Action: Foreign key: dbo.ItemModem.FK_Product_ItemModem - Removed.
Out of about 100 tables in my db, there are 3 that uses inheritance. These table are ItemPlug, ItemCtrl & ItemModem, and they all inherit from table Product. All the actions reported by ValidateDatabase are related to these three tables it seems, thus I suspect it might have to do with the inheritance.
The three foreign keys that are reported to be removed, looks just fine to me.
Here is an example of 1 of the 3 tables involved. The DDL from db for the table ItemPlug looks like this:
CREATE TABLE dbo.ItemPlug (
ProductID NVarChar(20) NOT NULL,
"Size" Int,
PlugTypeID Int NOT NULL,
SlipsTypeID Int NOT NULL,
PackerPlateID Int NOT NULL,
Length Float,
HardOD Float,
SetMin Float,
SetMax Float,
Min1_5DBendID Int,
Min3_0DBendID Int,
Min5_0DBendID Int,
DesignMAWP Float,
CONSTRAINT PK_ItemPlug PRIMARY KEY CLUSTERED (
ProductID
)
)
GO
ALTER TABLE dbo.ItemPlug WITH CHECK ADD CONSTRAINT FK_ItemPlug_Product FOREIGN KEY (ProductID)
REFERENCES dbo.Product (ID)
ON DELETE NO ACTION
ON UPDATE NO ACTION
GO
and the Product table looks like this:
CREATE TABLE dbo.Product (
ID NVarChar(20) NOT NULL,
ProductGroupID Int,
Name NVarChar(100),
SnmLink NVarChar(20),
SerialNumProductID NVarChar(20),
Assemble Bit NOT NULL,
ItemCategoryID NVarChar(10),
ItemTypeID Int,
ItemStatusID Int,
AX_ID NVarChar(20),
Revision NVarChar(10),
HasDataLogger Bit NOT NULL,
CONSTRAINT PK_Product PRIMARY KEY CLUSTERED (
ID
)
)
So my question is:
Why is that ValidateDatabase reports it will DROP the three FK's and apparently recreate them in this situation?