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

misc: Add github action to test DB migrations #1761

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

vincent-pochet
Copy link
Collaborator

Context

Few issues were reported in the past with database migrations on a fresh lago install.
Since the migration are not performed from the start when deploying on the cloud instance or on the local instances, some edge case could prevent some migration to perform correctly.

Description

This PR adds a github CI action to perform the migration from scratch making sure they all perform correctly

@vincent-pochet vincent-pochet self-assigned this Mar 7, 2024
@vincent-pochet vincent-pochet force-pushed the misc-migration-ci branch 21 times, most recently from 4573bd7 to acd4e3e Compare March 8, 2024 08:26
@vincent-pochet vincent-pochet changed the title misc: Add github action to perform DB migrations misc: Add github action to test DB migrations Mar 8, 2024
@vincent-pochet vincent-pochet merged commit 6d0230a into main Mar 8, 2024
7 checks passed
@vincent-pochet vincent-pochet deleted the misc-migration-ci branch March 8, 2024 09:48
julienbourdeau added a commit that referenced this pull request Apr 23, 2024
…1888)

## Description

Recently, a [new Action was set
up](#1761) to test DB
migrations. I agree 100% that the migrations should be tested as part of
the CI.

I propose to run the migration when setup the Actions to run rspec
instead of loading the schema.

A small benefit is that we don't need to setup a dedicated env "just" to
run the migrations.

A big benefit is that you can only commit `db/schema.rb` when your PR is
ready and still run the CI in the meantime. `schema.rb` will often cause
conflicts in PR that stays open for while. We aim for short-lived PR of
course, but sometimes some stay open longer.
drejc pushed a commit to fliqa-io/lago-api that referenced this pull request May 15, 2024
…etlago#1888)

## Description

Recently, a [new Action was set
up](getlago#1761) to test DB
migrations. I agree 100% that the migrations should be tested as part of
the CI.

I propose to run the migration when setup the Actions to run rspec
instead of loading the schema.

A small benefit is that we don't need to setup a dedicated env "just" to
run the migrations.

A big benefit is that you can only commit `db/schema.rb` when your PR is
ready and still run the CI in the meantime. `schema.rb` will often cause
conflicts in PR that stays open for while. We aim for short-lived PR of
course, but sometimes some stay open longer.
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.

None yet

2 participants