Skip to content

Added per-tier automation trigger migration - #30834

Draft
EvanHahn wants to merge 1 commit into
dont-let-members-run-the-same-automation-twicefrom
evanhahn-ny-1617-add-migration-to-store-trigger-data-on-automations
Draft

EvanHahn wants to merge 1 commit into
dont-let-members-run-the-same-automation-twicefrom
evanhahn-ny-1617-add-migration-to-store-trigger-data-on-automations

Conversation

@EvanHahn

@EvanHahn EvanHahn commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

closes https://linear.app/ghost/issue/NY-1617

New migration that:

  • creates automations.trigger_tier_scope column with backfill
  • creates the automation_trigger_tiers table

I considered adding a trigger_type column, but all automations are still something like "member signed up", so I don't think it's worth adding that column now. Easy to add in the future.

Also requires us to insert this new data for new automations created with the legacy automated emails endpoint.

@EvanHahn
EvanHahn added this pull request to stack #30836 September 16, 2026 20:31
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the migration [pull request] Includes migration for review label Sep 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

It looks like this PR contains a migration 👀
Here's the checklist for reviewing migrations:

General requirements

  • ⚠️ Tested performance on staging database servers, as performance on local machines is not comparable to a production environment
  • Satisfies idempotency requirement (both up() and down())
  • Does not reference models
  • Filename is in the correct format (and correctly ordered)
  • Targets the next minor version
  • All code paths have appropriate log messages
  • Uses the correct utils
  • Contains a minimal changeset
  • Does not mix DDL/DML operations

Schema changes

  • Both schema change and related migration have been implemented
  • For index changes: has been performance tested for large tables
  • For new tables/columns: fields use the appropriate predefined field lengths
  • For new tables/columns: field names follow the appropriate conventions
  • Does not drop a non-alpha table outside of a major version

Data changes

  • Mass updates/inserts are batched appropriately
  • Does not loop over large tables/datasets
  • Defends against missing or invalid data
  • For settings updates: follows the appropriate guidelines

@nx-cloud

nx-cloud Bot commented Sep 16, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 87872b5

Command Status Duration Result
nx run ghost:test:ci:e2e ❌ Failed 4m 2s View ↗
nx run ghost:test:e2e ❌ Failed 2m 55s View ↗
nx run-many -t test:types -p ghost ❌ Failed 3s View ↗
nx run ghost:test:legacy ✅ Succeeded 2m 29s View ↗
nx run-many -t test:unit -p ghost ✅ Succeeded 30s View ↗
nx run ghost-monorepo:lint:boundaries ✅ Succeeded 22s View ↗
nx run-many -t lint -p ghost,ghost-monorepo ✅ Succeeded 21s View ↗
nx run @tryghost/admin:build ✅ Succeeded 6s View ↗
Additional runs (2) ✅ Succeeded ... View ↗

💡 Dealing with memory or CPU issues? See memory and CPU details with the resource usage add-on ↗.


☁️ Nx Cloud last updated this comment at 2026-09-16 21:14:38 UTC

closes https://linear.app/ghost/issue/NY-1617

New migration that:

- creates `automations.trigger_tier_scope` column with backfill
- creates the `automation_trigger_tiers` table

I considered adding a `trigger_type` column, but all automations are
still something like "member signed up", so I don't think it's worth
adding that column now. Easy to add in the future.

Also requires us to insert this new data for new automations created
with the legacy automated emails endpoint.
@EvanHahn
EvanHahn force-pushed the evanhahn-ny-1617-add-migration-to-store-trigger-data-on-automations branch from 38c6b5b to 87872b5 Compare September 16, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

migration [pull request] Includes migration for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant