-
Notifications
You must be signed in to change notification settings - Fork 458
Inconsistency in migrations #1457
Comments
Was this rule not added to cater for this? - https://github.com/LiskHQ/lisk/blob/development/db/repos/migrations.js#L113
Change it to what - higher/lower value?
We can try, and see if anyone reports issues after such change...
We would need to execute a separate script to patch those, at some point, not yet sure when. Can we run such a script manually?
I thought the ascending order was provided through the |
And here's how you can patch your migrations: UPDATE migrations SET name = lower(regexp_replace(name, E'([A-Z])', E'\_\\1','g')); It will replace all camel-case records in column |
I have checked the order in which
so the migration strategy seems correct. |
Higher
If possible, as a migration in itself. |
So I've tried with this PR: #1473 But for some reasons that starts throwing errors:
Any idea why is that? ;) |
See #1473 (comment) |
The issue has been sorted, by applying the patch only if a migration is found. |
I don't think that we should rely on References: nodejs/node#3232 |
Another question, so now underscore patch for migration names will be executed every time (even if already done)? Why not do that as normal miration (with timestamp)? |
|
Ok fair point maybe.
Migration in itself was preferred, but runtime operation not bad either.
I believe it was renamed as requested. From:
Ok true, that was not changed. |
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 @karmacoma You posted ahead of me by a second 😄 |
@vitaly-t Regarding By normal migration I mean another migration in standard migrations chain, for example: From issue description: |
@4miners Issue now also assigned to you. Please implement remaining inconsistencies as you seen them and submit as a PR. |
For reference - state of
|
Expected behavior
N/A
Actual behavior
There are several inconsistency in our migration process:
20161016133824_addBroadhashColumnToPeers.sql
20161016133824_addHeightColumnToPeers.sql
have 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 to
ALTER TABLE "peers" ADD COLUMN IF NOT EXISTS "height" INT;
)ON CONFLICT DO NOTHING
, which is not acceptable, as migration should be only executed (and then inserted) once.migrations
table still contains old migration names for already executed migrations. For consistency entries in database should match new names.Steps to reproduce
N/A
Which version(s) does this affect? (Environment, OS, etc...)
1.0.0
The text was updated successfully, but these errors were encountered: