View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005722 | SymmetricDS | Bug | public | 2023-03-03 19:05 | 2023-03-14 14:53 |
Reporter | umssoft | Assigned To | pmarzullo | ||
Priority | urgent | ||||
Status | closed | Resolution | fixed | ||
Product Version | 3.14.5 | ||||
Target Version | 3.14.6 | Fixed in Version | 3.14.6 | ||
Summary | 0005722: Tries to create foreign key before creating the referenced table | ||||
Description | 2023-03-04 01:52:03,072 INFO [kiosk-001] [DefaultDatabaseWriter] [kiosk-001-dataloader-109] About to create table using the following definition: <?xml version="1.0"?> <!DOCTYPE database SYSTEM "http://db.apache.org/torque/dtd/database"> <database name="dataextractor" schema="UserSystem"> <table name="UserPersonalSettings"> <column name="UserId" primaryKey="true" primaryKeySeq="1" required="true" type="INTEGER" size="10"> <platform-column name="postgres95" type="int4" size="10"/> </column> <column name="MainThemeId" type="INTEGER" size="10"> <platform-column name="postgres95" type="int4" size="10"/> </column> <column name="SingleClickActionId" type="INTEGER" size="10"> <platform-column name="postgres95" type="int4" size="10"/> </column> <column name="OpenScheduleId" required="true" type="INTEGER" size="10" default="2"> <platform-column name="postgres95" type="int4" size="10" default="2"/> </column> <column name="ChartTypeIds" type="LONGVARCHAR"> <platform-column name="postgres95" type="text"/> </column> <column name="GatewayModeId" required="true" type="INTEGER" size="10" default="1"> <platform-column name="postgres95" type="int4" size="10" default="1"/> </column> <foreign-key name="UserPersonalSettings_UserId_fk" foreignTable="User" foreignTableCatalog="" foreignTableSchema="" foreignOnUpdateAction="CASCADE" foreignOnDeleteAction="CASCADE"> <reference local="UserId" foreign="Id"/> </foreign-key> </table> </database> 2023-03-04 01:52:03,088 INFO [kiosk-001] [PostgreSql95DatabasePlatform] [kiosk-001-dataloader-109] Running alter sql: ALTER TABLE "UserSystem"."UserPersonalSettings" ADD CONSTRAINT "UserPersonalSettings_UserId_fk" FOREIGN KEY ("UserId") REFERENCES "UserSystem"."User" ("Id") ON DELETE CASCADE ON UPDATE CASCADE; 2023-03-04 01:52:03,088 WARN [kiosk-001] [JdbcSqlTemplate] [kiosk-001-dataloader-109] ОШИБКА: отношение "UserSystem.User" не существует. Failed to execute: ALTER TABLE "UserSystem"."UserPersonalSettings" ADD CONSTRAINT "UserPersonalSettings_UserId_fk" FOREIGN KEY ("UserId") REFERENCES "UserSystem"."User" ("Id") ON DELETE CASCADE ON UPDATE CASCADE | ||||
Steps To Reproduce | symadmin send-schema | ||||
Additional Information | It tries to create a table which contains a foreign key referencing to another table without creating that table first. Why don't create all tables first and then add constraints? Also it doesn't recreate schemata, just says that it is does not exist. So I had to create it manually on the second DB to proceed. Not sure if this is a bug or just not supported. | ||||
Tags | ddl/schema, dialect: postgresql, initial/partial load | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2023-03-03 19:05 | umssoft | New Issue | |
2023-03-03 19:05 | umssoft | Tag Attached: ddl/schema | |
2023-03-03 19:05 | umssoft | Tag Attached: dialect: postgresql | |
2023-03-03 19:05 | umssoft | Tag Attached: initial/partial load | |
2023-03-13 12:52 | pmarzullo | Assigned To | => pmarzullo |
2023-03-13 12:52 | pmarzullo | Status | new => assigned |
2023-03-13 12:52 | pmarzullo | Target Version | => 3.14.6 |
2023-03-13 17:20 | pmarzullo | Status | assigned => resolved |
2023-03-13 17:20 | pmarzullo | Resolution | open => fixed |
2023-03-13 17:20 | pmarzullo | Fixed in Version | => 3.14.6 |
2023-03-13 17:20 | pmarzullo | Note Added: 0002293 | |
2023-03-13 18:00 | pmarzullo | Changeset attached | => SymmetricDS 3.14 6c8f235c |
2023-03-14 14:53 | elong | Relationship added | related to 0003952 |
2023-03-17 17:25 | admin | Status | resolved => closed |