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

LCFS - Add is_legacy Field to ProvisionOfTheAct and Migrate TFRS Provisions #1552

Open
14 tasks
AlexZorkin opened this issue Dec 20, 2024 · 0 comments
Open
14 tasks
Assignees
Labels
Added Banana 4 Scale Label for tickets added mid-sprint Medium Medium priority Task Work that does not directly impact the user

Comments

@AlexZorkin
Copy link
Collaborator

Description:
Introduce an is_legacy column to the provision_of_the_act table to differentiate legacy provisions from TFRS. Use an Alembic migration to insert TFRS provisions into LCFS, combining description and section reference into a single description field and setting is_legacy = true. This ensures accurate representation of historical data.

Purpose and benefit to user:
Supports historical analysis by accurately integrating legacy legislative provisions from TFRS, enabling comprehensive regulatory and compliance comparisons.

Acceptance Criteria:

  • Given I am a data migration engineer, when the Alembic migration is executed, the provision_of_the_act table includes an is_legacy column with default false.
  • Given the migration script executes, all TFRS provisions are inserted into the table with is_legacy = true and correctly mapped descriptions.
  • Given I am a data analyst, when querying the table, legacy provisions are accurately flagged and match TFRS source data.

Development Checklist:

  1. Schema Update:

    • Add is_legacy column to provision_of_the_act with default false.
    • Update SQLAlchemy ORM to include is_legacy.
  2. Data Mapping:

    • Combine TFRS description and section reference into LCFS description.
    • Ensure accurate mapping of all fields.
  3. Alembic Migration:

    • Create a new Alembic revision for schema update and data insertion.
    • Insert TFRS provisions with is_legacy = true.
  4. Validation:

    • Run migration in staging and validate data integrity.
    • Ensure no duplication or alteration of existing records.
    • Test filtering and queries by is_legacy.
  5. Deployment:

    • Backup production database before migration.
    • Apply migration and verify data in production.

Notes:

  • Validate all TFRS provisions before migration.
  • Ensure automated tests cover is_legacy filtering and queries.
  • Maintain clear documentation of changes for stakeholders.
@AlexZorkin AlexZorkin added Medium Medium priority Task Work that does not directly impact the user labels Dec 20, 2024
@RebekahRFord RebekahRFord added the Added Banana 4 Scale Label for tickets added mid-sprint label Jan 3, 2025
@dhaselhan dhaselhan self-assigned this Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Added Banana 4 Scale Label for tickets added mid-sprint Medium Medium priority Task Work that does not directly impact the user
Projects
None yet
Development

No branches or pull requests

3 participants