Bug 160339 - How Base relationships react at table or column renaming
Summary: How Base relationships react at table or column renaming
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
7.3.7.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-24 12:47 UTC by prrvchr
Modified: 2024-03-25 03:29 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description prrvchr 2024-03-24 12:47:54 UTC
Description:
Hi,

If I use jdbcDriverOOo[1] with Base, I have problems after renaming a table or column in Base at the relationship management level.

Although I have carried out all the necessary renaming of the indexes and keys involved in this renaming, this is not enough and I cannot get it to work satisfactorily.

In fact for the moment the only way to be able to manage foreign keys after renaming a table or a column, which is referenced by this foreign key, is to refresh the list of tables in Base using the menu: View -> Refresh Tables.

Maybe I'm missing something?


Steps to Reproduce:
1. In Base create a foreign key between two tables.
2. Rename one of the tables then one of the columns involved in the foreign key.
3. After each renaming, go to the foreign key management with the menu: Tools -> Relationships...

Actual Results:
After renaming the relationships are not displayed correctly.

Expected Results:
After renaming the relationships are displayed correctly.


Reproducible: Always


User Profile Reset: No

Additional Info:
If after renaming, you reload the tables using the menu: View -> Refresh Tables, then the display of the relationships is correct.

If it turns out that this is the solution, wouldn't Base detect that there has been a renaming and reload the tables right after?

[1] https://prrvchr.github.io/jdbcDriverOOo/#what-has-been-done-for-version-130
Comment 1 prrvchr 2024-03-25 03:29:25 UTC
Well I ended up finding, if you rename a primary key you must also rename the RelatedColumn property on the KeyColumns involved in the foreign keys linked to this primary key.