Skip to content

Fix migration branching error for google_calendar_channels#1655

Merged
davinotdavid merged 1 commit into
mainfrom
fix-migration-branching
Apr 28, 2026
Merged

Fix migration branching error for google_calendar_channels#1655
davinotdavid merged 1 commit into
mainfrom
fix-migration-branching

Conversation

@davinotdavid
Copy link
Copy Markdown
Contributor

@davinotdavid davinotdavid commented Apr 28, 2026

What changed?

  • Added time_created and time_updated to the existing add_google_calendar_channels migration
  • Fixed the dependency of add_state_to_google_calendar migration so that the table can be created before the state is added
  • Add a new migration to add the timestamps in case they are not added yet

Why?

The time_created and time_updated fields are defined on the SQLAlchemy model but not in the migration, so when we run the db creation methods from scratch when blowing up our local envs, it creates the correct tables from the model definitions.

However, if the DB already exists (ran on this during stage testing and would happen in prod too), these columns wouldn't exist since they are not defined in the migration explicitly.

Also, there was an ordering bug on the migrations which made the add-column run before the create-table. Added an extra migration to stay on the safe side to make sure that the missing columns will be there.

Related PRs

#1529

@davinotdavid davinotdavid merged commit 88473b8 into main Apr 28, 2026
8 checks passed
@davinotdavid davinotdavid deleted the fix-migration-branching branch April 28, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants