Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a CI check to make sure typeorm models are always in sync with migrations #8865

Closed
FelixMalfait opened this issue Dec 4, 2024 · 0 comments · Fixed by #8867
Closed

Add a CI check to make sure typeorm models are always in sync with migrations #8865

FelixMalfait opened this issue Dec 4, 2024 · 0 comments · Fixed by #8867
Assignees
Labels

Comments

@FelixMalfait
Copy link
Member

When we update a model that lives in core/metadata schema we need to run the following command to generate the relevant migrations:

npx nx run twenty-server:typeorm --migration:generate src/database/typeorm/metadata/migrations/nameOfYourMigration -d src/database/typeorm/metadata/metadata.datasource.ts # (orcore data source)

Sometimes people will create migrations manually or just forget to run this command, resulting in migrations not being created at the right moment and usually getting picked up in a sub-sequent unrelated PR.

In order to avoid this, we would like to add a step in the server CI that will make sure the migration generation commands do not generate any file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants