Skip to content

Convert models.py: 8. Reporting and Historical Models #1258

@xlorepdarkhelm

Description

@xlorepdarkhelm

Note: This issue depends on #1257 to be completed and its PR merged before it can be started.

Converting models.py to SQLAlchemy 2.0 standards is a complex process, this issue is for updating the following model classes:

  • FactBilling
  • FactNotificationStatus
  • FactProcessingTime
  • Complaint
  • ServiceDataRetention

These models require the following steps to be done for them (explained in Convert models.py classes to using SQLAlchemy 2.0 standards #1246):

  1. Use of Mapped and Type Hints
  2. Relationships
  3. Use of Mapped for Collections
  4. Constraints and Indexes
  5. Enum and Other Columns
  6. Class Methods and Properties
  7. Sessions

Acceptance Criteria:

  • Make the necessary changes to the model fields
  • Double check that running the migrations and tests still work as expected with no deviation from the previous code
  • Verify that a deploy to staging works with the changes once merged

Security Considerations

As SQLAlchemy 2.0+ is now released, the older 1.4 way is deprecated, and may not recieve security updates, as well as are expected to be completely phased out of the codebase in the relatively near future.

Other than that, there's really nothing. The end goal should be that this changes models.py and doesn't impact anything else.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Issue Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions