lisk-sdk: Inconsistency in migrations
Expected behavior
N/A
Actual behavior
There are several inconsistency in our migration process:
- Files
20161016133824_addBroadhashColumnToPeers.sql20161016133824_addHeightColumnToPeers.sqlhave same ID, that can result with second migration beign not applied correctly on some nodes. We should change ID of second migration and try to re-execute it if needed (change query toALTER TABLE "peers" ADD COLUMN IF NOT EXISTS "height" INT;) - Query that inserts to migations table have
ON CONFLICT DO NOTHING, which is not acceptable, as migration should be only executed (and then inserted) once. - After renaming all SQL files to underscore case (in https://github.com/LiskHQ/lisk/pull/1455) - entries in
migrationstable still contains old migration names for already executed migrations. For consistency entries in database should match new names. - We should review migration script if it sorts migrations based on ID ascending and then executes them, because migrations should be executed in strict order.
Steps to reproduce
N/A
Which version(s) does this affect? (Environment, OS, etc…)
1.0.0
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (15 by maintainers)
Commits related to this issue
- fixing #1457 — committed to LiskHQ/lisk-sdk by vitaly-t 6 years ago
- Merge pull request #1473 from LiskHQ/1457-migration-patch Patching migrations - Closes #1457 — committed to LiskHQ/lisk-sdk by karmacoma 6 years ago
- Merge pull request #1510 from LiskHQ/1457_migrations_inconsistency Inconsistency in migrations - Closes #1457 — committed to LiskHQ/lisk-sdk by karmacoma 6 years ago
See https://github.com/LiskHQ/lisk/pull/1473#issuecomment-362061038
@4miners Issue now also assigned to you. Please implement remaining inconsistencies as you seen them and submit as a PR.
You gave a link to some very old, Windows-specific issue. Why do we care about that?
Could you, please clarify, what you mean by normal migration (with timestamp)?
It was renamed into one with higher timestamp, as per the PR. The name changed from
20161016133824_to20161016133825_@karmacoma You posted ahead of me by a second 😄