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

Database migration fails partially on macOS (and other hosts with case insensitive filesystem) #6139

Open
stweil opened this issue Jul 22, 2024 · 4 comments · May be fixed by #6333
Open

Database migration fails partially on macOS (and other hosts with case insensitive filesystem) #6139

stweil opened this issue Jul 22, 2024 · 4 comments · May be fixed by #6333
Labels

Comments

@stweil
Copy link
Member

stweil commented Jul 22, 2024

Describe the bug

The SQL statements in Kitodo-DataManagement/src/main/resources/db/migration/V2_105__Fixes_#3998.sql which were introduced in pull request #4412 don't work on hosts with a filesystem which is case insensitive (macOS, Windows).

An easy workaround is using an intermediate filename:

Replace

ALTER TABLE client_x_listColumn RENAME TO client_x_listcolumn;

by

ALTER TABLE client_x_listColumn RENAME TO renamed_table;
ALTER TABLE renamed_table RENAME TO client_x_listcolumn;

and similarly for all other renames.

To Reproduce
Steps to reproduce the behavior:

  1. Run migration on macOS.
  2. Check names of database tables.
  3. See error

Expected behavior
Database migration must work on macOS and Windows (and Linux with a case insensitive filesystem), too.

Release
All recent releases up to git master.

@stweil stweil added the bug label Jul 22, 2024
@stweil
Copy link
Member Author

stweil commented Jul 22, 2024

@matthias-ronge, @solth, should I prepare a PR with the suggested fix for the SQL file? Or do you have a different solution?

@stweil
Copy link
Member Author

stweil commented Jul 25, 2024

If we patch the existing migration script, this will require a flyway:repair for at least some existing installations. Is this acceptable? See related discussion for typo fixes in pull request #6149.

@henning-gerhardt
Copy link
Collaborator

My question is: why this is failing on your system? So far as I know this is working on Windows and if I remember me correct this was working on MacOS too.

@stweil
Copy link
Member Author

stweil commented Jul 25, 2024

stweil added a commit to stweil/kitodo-production that referenced this issue Dec 1, 2024
For case sensitive filesystems which are typically used by Linux
such renames were already done in earlier migration steps, but
those steps have no effect on macOS and Windows.

The new SQL migration code renames any table name with uppercase
letters to a lowercase table name.

The script was created by Claude.AI.

Fixes: kitodo#6139
Signed-off-by: Stefan Weil <[email protected]>
stweil added a commit to stweil/kitodo-production that referenced this issue Dec 1, 2024
For case sensitive filesystems which are typically used by Linux
such renames were already done in earlier migration steps, but
those steps have no effect on macOS and Windows.

The new SQL migration code renames any table name with uppercase
letters to a lowercase table name.

The script was created by Claude.AI.

Fixes: kitodo#6139
Signed-off-by: Stefan Weil <[email protected]>
stweil added a commit to stweil/kitodo-production that referenced this issue Dec 19, 2024
For case sensitive filesystems which are typically used by Linux
such renames were already done in earlier migration steps, but
those steps have no effect on macOS and Windows.

The new SQL migration code renames any table name with uppercase
letters to a lowercase table name.

The script was created by Claude.AI.

Fixes: kitodo#6139
Signed-off-by: Stefan Weil <[email protected]>
stweil added a commit to stweil/kitodo-production that referenced this issue Jan 10, 2025
For case sensitive filesystems which are typically used by Linux
such renames were already done in earlier migration steps, but
those steps have no effect on macOS and Windows.

The new SQL migration code renames any table name with uppercase
letters to a lowercase table name.

The script was created by Claude.AI.

Fixes: kitodo#6139
Signed-off-by: Stefan Weil <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants