Skip to content

Fix: Schema Compatibility Issue for Existing file_status Table#9

Merged
ritwik-g merged 2 commits intomainfrom
fix-table-schema
Nov 19, 2024
Merged

Fix: Schema Compatibility Issue for Existing file_status Table#9
ritwik-g merged 2 commits intomainfrom
fix-table-schema

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 a team and ritwik-g 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
Modified the `init_db()` function to ensure the column addition logic always executes.

Signed-off-by: pk-zipstack <praveen@zipstack.com>
@ritwik-g ritwik-g merged commit 11c46b5 into main Nov 19, 2024
@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