Skip to content

Cycle Model Database #26

@b-at-neu

Description

@b-at-neu

Context

Application currently has no cycle tracking. All applications, nominations, endorsements, and settings exist in single timeframe.

Goal

Create Cycle model and add cycleId to applications, nominations, endorsements, settings. Migrate existing data to default active cycle.

Schema Changes

  • Create Cycle model: id, name, isActive (Boolean), createdAt, updatedAt, deletedAt
  • Add cycleId (required FK) to Application, Nomination, Endorsement
  • Add cycleId (required FK, unique) to Settings
  • Add relations on all models

Migration Steps

  1. Create Cycle model
  2. Create default cycle: { name: "Current Cycle", isActive: true }
  3. Add cycleId fields to existing models
  4. Migrate all existing applications to default cycle
  5. Migrate all existing nominations to default cycle
  6. Migrate all existing endorsements to default cycle
  7. Migrate existing settings record to default cycle (link via cycleId)

Acceptance Criteria

  • Cycle model created with isActive field
  • All applications have cycleId
  • All nominations have cycleId
  • All endorsements have cycleId
  • Settings has cycleId with unique constraint
  • Existing data migrated to default active cycle
  • CommunityConstituency unchanged

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions