Skip to content

Conversation

vincent-pochet
Copy link
Collaborator

@vincent-pochet vincent-pochet commented Jun 13, 2025

Context

As we are planing to release the "not null organization" pull request, it was decided to take this as an opportunity to squash the old database migration into a single migration file, to reduce the number of migrations.

Related to #3829

Description

Lago version 1.20.0 was used as a reference to squash the migrations.

  • All migrations from previous versions are merged in a single InitialMigration migration file.
    • It uses the SQL format to preserve the orders and make sure the migration test workflow continue to pass on Github no matter if the structure comes from previous migrations or from this file.
    • It reuse the previous last migration version 20250122112050 to make sure it will not be executed on instance running v1.20.0 or later.
    • It adds a small check to fail running the migration if an upgrade is made from a version prior to 1.20.0 to the bridge release containing this change
  • All squashed migrations files are removed

@vincent-pochet vincent-pochet force-pushed the chore-squash-migrations branch 9 times, most recently from 8004fe5 to 9aea9ff Compare June 13, 2025 10:03
@vincent-pochet vincent-pochet marked this pull request as ready for review June 13, 2025 12:20
@groyoh
Copy link
Contributor

groyoh commented Jun 13, 2025

Shouldn't the schema_migrations in structure.sql be impacted ?

@vincent-pochet
Copy link
Collaborator Author

Shouldn't the schema_migrations in structure.sql be impacted ?

@groyoh, no, we actually don't want it to be impacted, the InitialMigration should not be executed if you already have an up to date structure.sql.
That's it is filling all the version numbers and reusing an existing one.
The goal is that no matter if you create your database using the previous migrations files or this new squashed migration, you end-up with the exact same structure.

@vincent-pochet vincent-pochet force-pushed the chore-squash-migrations branch from f20ee96 to 2d76947 Compare June 17, 2025 08:32
@vincent-pochet vincent-pochet force-pushed the chore-squash-migrations branch from 2d76947 to 4f4b150 Compare June 17, 2025 09:53
@vincent-pochet vincent-pochet merged commit 7d95e48 into main Jun 17, 2025
14 checks passed
@vincent-pochet vincent-pochet deleted the chore-squash-migrations branch June 17, 2025 11:48
rsempe added a commit that referenced this pull request Jun 17, 2025
rsempe added a commit that referenced this pull request Jun 17, 2025
Reverts #3829

We want to exclude that from the `1.30` self-hosted release.
Will be included on the `1.31` release.
vincent-pochet added a commit that referenced this pull request Jun 26, 2025
…#3842)

Reapply #3839 that was
rollbacked to allow a non blocking release

## Context

As we are planing to release the ["not null organization" pull
request](#3687), it was decided
to take this as an opportunity to squash the old database migration into
a single migration file, to reduce the number of migrations.

Related to #3829

## Description

Lago version 1.20.0 was used as a reference to squash the migrations.

- All migrations from previous versions are merged in a single
`InitialMigration` migration file.
- It uses the SQL format to preserve the orders and make sure the
migration test workflow continue to pass on Github no matter if the
structure comes from previous migrations or from this file.
- It reuse the previous last migration version `20250122112050` to make
sure it will not be executed on instance running v1.20.0 or later.
- It adds a small check to fail running the migration if an upgrade is
made from a version prior to 1.20.0 to the bridge release containing
this change
- All squashed migrations files are removed
diegocharles pushed a commit that referenced this pull request Jun 30, 2025
…#3842)

Reapply #3839 that was
rollbacked to allow a non blocking release

## Context

As we are planing to release the ["not null organization" pull
request](#3687), it was decided
to take this as an opportunity to squash the old database migration into
a single migration file, to reduce the number of migrations.

Related to #3829

## Description

Lago version 1.20.0 was used as a reference to squash the migrations.

- All migrations from previous versions are merged in a single
`InitialMigration` migration file.
- It uses the SQL format to preserve the orders and make sure the
migration test workflow continue to pass on Github no matter if the
structure comes from previous migrations or from this file.
- It reuse the previous last migration version `20250122112050` to make
sure it will not be executed on instance running v1.20.0 or later.
- It adds a small check to fail running the migration if an upgrade is
made from a version prior to 1.20.0 to the bridge release containing
this change
- All squashed migrations files are removed
diegocharles pushed a commit that referenced this pull request Jul 11, 2025
## Context

As we are planing to release the ["not null organization" pull
request](#3687), it was decided
to take this as an opportunity to squash the old database migration into
a single migration file, to reduce the number of migrations.

Related to #3829

## Description

Lago version 1.20.0 was used as a reference to squash the migrations.

- All migrations from previous versions are merged in a single
`InitialMigration` migration file.
- It uses the SQL format to preserve the orders and make sure the
migration test workflow continue to pass on Github no matter if the
structure comes from previous migrations or from this file.
- It reuse the previous last migration version `20250122112050` to make
sure it will not be executed on instance running v1.20.0 or later.
- It adds a small check to fail running the migration if an upgrade is
made from a version prior to 1.20.0 to the bridge release containing
this change
- All squashed migrations files are removed
diegocharles pushed a commit that referenced this pull request Jul 11, 2025
Reverts #3829

We want to exclude that from the `1.30` self-hosted release.
Will be included on the `1.31` release.
diegocharles pushed a commit that referenced this pull request Jul 11, 2025
…#3842)

Reapply #3839 that was
rollbacked to allow a non blocking release

## Context

As we are planing to release the ["not null organization" pull
request](#3687), it was decided
to take this as an opportunity to squash the old database migration into
a single migration file, to reduce the number of migrations.

Related to #3829

## Description

Lago version 1.20.0 was used as a reference to squash the migrations.

- All migrations from previous versions are merged in a single
`InitialMigration` migration file.
- It uses the SQL format to preserve the orders and make sure the
migration test workflow continue to pass on Github no matter if the
structure comes from previous migrations or from this file.
- It reuse the previous last migration version `20250122112050` to make
sure it will not be executed on instance running v1.20.0 or later.
- It adds a small check to fail running the migration if an upgrade is
made from a version prior to 1.20.0 to the bridge release containing
this change
- All squashed migrations files are removed
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