Skip to content

fix: preserve bridge.to_address (partial cherry-pick of PR #1452) v0.8.x#1499

Merged
joanestebanr merged 5 commits intorelease/0.8from
fix/dont_lose_bridge_to_address_data_on_migration-v0_8_x
Mar 2, 2026
Merged

fix: preserve bridge.to_address (partial cherry-pick of PR #1452) v0.8.x#1499
joanestebanr merged 5 commits intorelease/0.8from
fix/dont_lose_bridge_to_address_data_on_migration-v0_8_x

Conversation

@joanestebanr
Copy link
Collaborator

@joanestebanr joanestebanr commented Feb 27, 2026

🔄 Changes Summary

Cherry-pick #1395

Preserve to_address when set bridge.to_address to DEFAULT ''

  • To modify the default values of this field it drop the field and add again. This migration is 13 only in v0.8.1.
  • The idea is copy this value before modifying the field, this is going to a modification of migration 13 for v0.8.1 that will be useful if you are comming from a v0.7.x to v0.8.2 (pending PR)

🔗 Related PRs

@joanestebanr joanestebanr changed the title fix: preserve bridge.to_address (partial cherry-pick of PR #1452) fix: preserve bridge.to_address (partial cherry-pick of PR #1452) v0.8.x Feb 27, 2026
joanestebanr added a commit that referenced this pull request Feb 27, 2026
#1452)

## 🔄 Changes Summary
### Migration scripts conflicts

| migration | v0.8.1 | v0.9.0 / develop |

|-----------|------------------------------------------|--------------------------------------------------------|
| 11 | | ✅ |
| 12 | + claim.type, + bridge.to_address | ✅ same ❌ +bridge.source ❌
+backward_let, ... |
| 13 | + bridge.to_address default | ❌ don't exists |

The main conflict is that migration 12 add `bridge.source` for >v0.8.1: 
- Sqlite doesn't have `ALTER TABLE IF NOT EXISTS FIELD...`. So from a
`sql` file it's not possible to solve the problem
- Migration library `github.com/rubenv/sql-migrate` have no way of doing
that if sql doesn't support it

Solution: 
- Add a indempotent function that is called in each migration that add
the field if doesn't exists
 
### Delete `bridge.to_address` content to set `DEFAULT ''`
- To modify the default values of this field it drop the field and add
again. This migration is 13 only in v0.8.1.
- The idea is copy this value before modifying the field, this is going
to a modification of migration 13 for v0.8.1 that will be useful if you
are comming from a v0.7.x to v0.8.2 (pending PR)


## 🔗 Related PRs
- #1453
- #1499
-

---------

Co-authored-by: joanestebanr <129153821+joanestebanr@users.noreply.github.com>
joanestebanr and others added 3 commits March 2, 2026 10:31
## 🔄 Changes Summary
- This PR fixes a bug in claims count logic 

## 🐞 Issues
- Closes #1391
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 2, 2026

@joanestebanr joanestebanr enabled auto-merge (squash) March 2, 2026 10:17
@joanestebanr joanestebanr merged commit 9833b22 into release/0.8 Mar 2, 2026
24 of 25 checks passed
@joanestebanr joanestebanr deleted the fix/dont_lose_bridge_to_address_data_on_migration-v0_8_x branch March 2, 2026 11:03
joanestebanr added a commit that referenced this pull request Mar 2, 2026
#1452)

| migration | v0.8.1 | v0.9.0 / develop |

|-----------|------------------------------------------|--------------------------------------------------------|
| 11 | | ✅ |
| 12 | + claim.type, + bridge.to_address | ✅ same ❌ +bridge.source ❌
+backward_let, ... |
| 13 | + bridge.to_address default | ❌ don't exists |

The main conflict is that migration 12 add `bridge.source` for >v0.8.1:
- Sqlite doesn't have `ALTER TABLE IF NOT EXISTS FIELD...`. So from a
`sql` file it's not possible to solve the problem
- Migration library `github.com/rubenv/sql-migrate` have no way of doing
that if sql doesn't support it

Solution:
- Add a indempotent function that is called in each migration that add
the field if doesn't exists

- To modify the default values of this field it drop the field and add
again. This migration is 13 only in v0.8.1.
- The idea is copy this value before modifying the field, this is going
to a modification of migration 13 for v0.8.1 that will be useful if you
are comming from a v0.7.x to v0.8.2 (pending PR)

- #1453
- #1499
-

---------

Co-authored-by: joanestebanr <129153821+joanestebanr@users.noreply.github.com>
joanestebanr added a commit that referenced this pull request Mar 2, 2026
….1 and v0.9.0/develop (#1508)

cherry-pick (#1452)

## 🔄 Changes Summary
### Migration scripts conflicts

| migration | v0.8.1 | v0.9.0 / develop |

|-----------|------------------------------------------|--------------------------------------------------------|
| 11 | | ✅ |
| 12 | + claim.type, + bridge.to_address | ✅ same ❌ +bridge.source ❌
+backward_let, ... |
| 13 | + bridge.to_address default | ❌ don't exists |

The main conflict is that migration 12 add `bridge.source` for >v0.8.1: 
- Sqlite doesn't have `ALTER TABLE IF NOT EXISTS FIELD...`. So from a
`sql` file it's not possible to solve the problem
- Migration library `github.com/rubenv/sql-migrate` have no way of doing
that if sql doesn't support it

Solution: 
- Add a indempotent function that is called in each migration that add
the field if doesn't exists
 
### Delete `bridge.to_address` content to set `DEFAULT ''`
- To modify the default values of this field it drop the field and add
again. This migration is 13 only in v0.8.1.
- The idea is copy this value before modifying the field, this is going
to a modification of migration 13 for v0.8.1 that will be useful if you
are comming from a v0.7.x to v0.8.2 (pending PR)


## 🔗 Related PRs
- #1453
- #1499
- #1452

---------

Co-authored-by: Rachit Sonthalia <54906134+rachit77@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants