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

[Bug] | Migration uses ALTER COLUMN which is not supported in SQLite #493

Open
2 tasks done
pluiedev opened this issue Nov 21, 2024 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@pluiedev
Copy link

pluiedev commented Nov 21, 2024

Are you using the latest release?

  • Yes, I am using the latest release.

Have you checked a bug report doesn't already exist?

  • Yes, I have checked the existing bug reports.

What happened?

When Wizarr is launched with a fresh database, the 2024-04-30_16-44-17.py migration fails because it tries to execute ALTER TABLE invitations ALTER COLUMN live_tv SET DATA TYPE BOOLEAN;, which is not supported on SQLite (SQLite only implements RENAME COLUMN, ADD COLUMN, and DROP COLUMN).

I believe that the correct way to implement it would be to transfer the data to a temporary table of some kind, (see https://stackoverflow.com/questions/2083543/modify-a-columns-type-in-sqlite3)

(Also, I thought the point of using an ORM like peewee was that you don't have to write raw SQL queries? That could've caught the bug much earlier)

Virtualisation

Other

What operating system are you seeing the problem on?

Linux

What browsers are you seeing the problem on?

Firefox

Project Location

Local

Relevant Log Output

[2024-11-21 16:33:10 +0100] [974554] [INFO] Starting gunicorn 21.2.0
[2024-11-21 16:33:10 +0100] [974554] [INFO] Listening at: http://127.0.0.1:8000 (974554)
[2024-11-21 16:33:10 +0100] [974554] [INFO] Using worker: geventwebsocket.gunicorn.workers.GeventWebSocketWorker
[2024-11-21 16:33:10 +0100] [974555] [INFO] Booting worker with pid: 974555
Starting migrations at 2024-11-21 16:33:11
Running migration 2023-10-10_21-34-32.py
MIGRATION: /nix/store/mg87rqf2zp3xaqjnvxkm6bpzsn658w6r-wizarr-4.1.1/lib/python3.11/site-packages/app/migrator/migrations/2023-10-10_21-34-32.py run successfully
MIGRATION INFO: Upgrades people from all versions before 2.2.1
Running migration 2023-10-11_20-19-17.py
MIGRATION: /nix/store/mg87rqf2zp3xaqjnvxkm6bpzsn658w6r-wizarr-4.1.1/lib/python3.11/site-packages/app/migrator/migrations/2023-10-11_20-19-17.py run successfully
MIGRATION INFO: Upgrades people from all versions on 2.2.1
Running migration 2023-10-11_20-48-19.py
MIGRATION: /nix/store/mg87rqf2zp3xaqjnvxkm6bpzsn658w6r-wizarr-4.1.1/lib/python3.11/site-packages/app/migrator/migrations/2023-10-11_20-48-19.py run successfully
MIGRATION INFO: Upgrades people to V3.4.2
Running migration 2023-10-11_23-11-06.py
Running migration 2023-10-11_23-33-47.py
Running migration 2023-10-14_21-46-16.py
Column tutorial already exists
Migration 2023-10-14_21-46-16 complete
Running migration 2023-10-28_19-21-23.py
Column name already exists
Column server_id already exists
Migration 2023-10-28_19-21-23 complete
Running migration 2023-10-29_16-35-41.py
Column auth already exists
Migration 2023-10-29_16-35-41 complete
Running migration 2024-04-19_18-46-37.py
Column sessions already exists
Migration 2024-04-19_18-46-37 complete
Running migration 2024-04-22_19-17-37.py
Column live_tv already exists
Migration 2024-04-22_19-17-37 complete
Running migration 2024-04-30_16-44-17.py
Failed to run migration 2024-04-30_16-44-17 on line 85
near "ALTER": syntax error
Running migration 2024-05-03_22-33-10.py
Column plex_home already dropped
Migration 2024-05-03_22-33-10 complete
Finished migrations in 0.224967 seconds
16:33:11 INFO Scheduler started
16:33:11 INFO Added job "check_expiring_users" to job store "default"
16:33:11 INFO Added job "clear_revoked_sessions" to job store "default"
16:33:11 INFO Added job "scan_users" to job store "default"
16:33:11 INFO Added job "check_for_updates" to job store "default"
@pluiedev pluiedev added the bug Something isn't working label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant