Skip to content

CMS-1613: Add Feature "datesCanSpan2Years" field#1845

Open
duncan-oxd wants to merge 3 commits into
mainfrom
CMS-1613-dates-span-2-yrs
Open

CMS-1613: Add Feature "datesCanSpan2Years" field#1845
duncan-oxd wants to merge 3 commits into
mainfrom
CMS-1613-dates-span-2-yrs

Conversation

@duncan-oxd
Copy link
Copy Markdown
Collaborator

@duncan-oxd duncan-oxd commented Jun 1, 2026

Jira Ticket:

CMS-1613

Description:

Part 1 of the multi-part task to allow certain features to bypass some validation rules. This adds a boolean flag field "Dates can span 2 years" to Strapi. The next steps are:

  • Add that field to the DOOT db
  • Sync that field from Strapi via sync scripts
  • Update the validation to check that field and bypass the rules as needed.

I tagged this with 3.1.0 for now but we can change it. It just needs to go to production before the associated DOOT update does.

Instead of the "two start" migration pattern we were using in the past, this creates the new fields in the migration so it only needs to run once. 👍

@duncan-oxd duncan-oxd requested a review from Copilot June 1, 2026 17:45
@duncan-oxd duncan-oxd self-assigned this Jun 1, 2026
@duncan-oxd duncan-oxd added the v3.1.0 TBD: Post-Strapi-5 label Jun 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new boolean field to the Strapi park-feature content type to support upcoming validation rule bypasses for features whose operating dates can span across two calendar years, and includes a CMS DB migration to backfill/populate this field for a known set of features.

Changes:

  • Add datesCanSpan2years boolean attribute (default false, required) to the park-feature Strapi schema.
  • Add a Knex migration that ensures the backing column exists and sets dates_can_span_2_years = true for specific feature_id values.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/cms/src/api/park-feature/content-types/park-feature/schema.json Adds the new Strapi boolean attribute to the park-feature content type.
src/cms/database/migrations/2026.05.29T00.00.011-populate-feature-dates-can-span-2years.js Adds/updates the CMS DB column and populates true for a predefined set of features.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +34 to +37
// Update the specified features to have their datesCanSpan2years value set to true
await knex("park_features")
.whereIn("feature_id", featureIds)
.update({ dates_can_span_2_years: true });
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is necessary if the column is being created right here in the migration, but I can update it if it's risky

@duncan-oxd duncan-oxd marked this pull request as ready for review June 1, 2026 17:54
@duncan-oxd duncan-oxd requested review from ayumi-oxd and molund June 1, 2026 17:54
@duncan-oxd duncan-oxd changed the title CMS-1613: Add Feature "datesCanSpan2years" field CMS-1613: Add Feature "datesCanSpan2Years" field Jun 2, 2026
@duncan-oxd duncan-oxd force-pushed the CMS-1613-dates-span-2-yrs branch from f5cea61 to 256bed8 Compare June 2, 2026 00:57
@duncan-oxd
Copy link
Copy Markdown
Collaborator Author

Note that I just pushed an update to rename the field to datesCanSpan2Years with a capital "Y" 👍 I mentioned it to UX that it's the convention when naming fields like this.

@molund molund added act-cms ACT – Strapi CMS release and removed act-cms ACT – Strapi CMS release labels Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3.1.0 TBD: Post-Strapi-5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants