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

Fix: Schema Compatibility Issue for Existing file_status Table #9

Merged
merged 2 commits into from
Nov 19, 2024

Conversation

pk-zipstack
Copy link
Contributor

What

  • Fixed the issue with table schema users face when they're in a previous version

Why

  • This issue completely blocks the functionality of the script if the user already has an existing table

How

  • Added a check to validate if the file_status table exists.
  • Used PRAGMA table_info to inspect the schema and conditionally add missing columns.
  • Applied logic to optimize schema validation, skipping it when the table is newly created.

Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)

  • No, this change only affects the schema validation and column addition process without altering any existing functionality.

@pk-zipstack pk-zipstack requested review from ritwik-g and a team November 18, 2024 09:52
@pk-zipstack pk-zipstack self-assigned this Nov 18, 2024
@pk-zipstack pk-zipstack requested review from kirtimanmishrazipstack and removed request for a team November 18, 2024 09:52
main.py Show resolved Hide resolved
Modified the `init_db()` function to ensure the column addition logic always executes.

Signed-off-by: pk-zipstack <[email protected]>
main.py Show resolved Hide resolved
@ritwik-g ritwik-g merged commit 11c46b5 into main Nov 19, 2024
2 checks passed
@ritwik-g ritwik-g deleted the fix-table-schema branch November 19, 2024 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants