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

Image datatype #65

Open
Joeyyyys opened this issue Feb 6, 2024 · 0 comments
Open

Image datatype #65

Joeyyyys opened this issue Feb 6, 2024 · 0 comments
Assignees
Labels
Backend backend related bug Something isn't working

Comments

@Joeyyyys
Copy link
Contributor

Joeyyyys commented Feb 6, 2024

  1. Database Schema Update:

    • Modify the database schema for the image storage column to change its data type from string to the appropriate data type for images, likely BLOB or BYTEA, depending on your database system.
  2. Migration Script:

    • Create a Knex migration script to apply the changes to the database. This script should handle altering the column type and converting existing string data to the new image data type.
  3. Data Conversion Logic:

    • Develop a data conversion logic within the migration script or a separate script that iterates through existing records, converts the image URLs stored as strings into the new image data type, and updates the database accordingly.
  4. Testing and Validation:

    • Thoroughly test the migration script to ensure the conversion process is successful and doesn't result in data loss. Validate that images are correctly stored in the new data type.
  5. Backup and Rollback Strategy:

    • Before applying the migration, ensure you have a backup of the database. Additionally, implement a rollback strategy in case issues arise during the migration process, allowing you to revert to the previous state.
@Joeyyyys Joeyyyys added bug Something isn't working Backend backend related labels Feb 6, 2024
@Joeyyyys Joeyyyys self-assigned this Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend backend related bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant