status-go
status-go copied to clipboard
drop incorrect index on user_messages_edits and create index on user_messages_deletes
In protocol/migrations/sqlite/1625762506_add_deleted_messages.up.sql an index is created on user_messages_edits but it should instead be created on user_messages_deletes.
Drop the incorrect index and create the correct one.
I installed go-bindata via make gen-install, and I ran go generate within the protocol/migrations/sqlite directory.
Let me know if I missed a step or did something incorrectly and I'll fix it ASAP.
Pull Request Checklist
- [ ] Have you updated the documentation, if impacted (e.g. docs.status.im)?
- [ ] Have you tested changes with mobile or desktop version?
Jenkins Builds
Click to see older builds (3)
| :grey_question: | Commit | :hash: | Finished (UTC) | Duration | Platform | Result |
|---|---|---|---|---|---|---|
| :heavy_check_mark: | 563309ff | #1 | 2021-09-08 20:01:21 | ~2 min | linux |
:package:zip |
| :heavy_check_mark: | 563309ff | #1 | 2021-09-08 20:02:07 | ~3 min | ios |
:package:zip |
| :heavy_check_mark: | 563309ff | #1 | 2021-09-08 20:05:40 | ~6 min | android |
:package:aar |
| :grey_question: | Commit | :hash: | Finished (UTC) | Duration | Platform | Result |
|---|---|---|---|---|---|---|
| :heavy_check_mark: | cafb9832 | #2 | 2021-10-04 06:22:16 | ~3 min | linux |
:package:zip |
| :heavy_check_mark: | cafb9832 | #2 | 2021-10-04 06:22:44 | ~4 min | ios |
:package:zip |
| :heavy_check_mark: | cafb9832 | #2 | 2021-10-04 06:25:05 | ~6 min | android |
:package:aar |
| :heavy_check_mark: | 006150c8 | #3 | 2021-10-05 18:58:16 | ~2 min | ios |
:package:zip |
| :heavy_check_mark: | 006150c8 | #3 | 2021-10-05 18:58:25 | ~2 min | linux |
:package:zip |
| :heavy_check_mark: | 006150c8 | #3 | 2021-10-05 19:02:10 | ~6 min | android |
:package:aar |
Hey @michaelsbradleyjr the filename of your migration should have the *.up.sql suffix otherwise it won't be picked up by the migrator.
There are also a helpful make commands that will prefix with a unix timestamp and the correct suffixes for you,
make migration D=<MIGRATION NAME>- Outputs to
appdatabase/migrations/sql/<MIGRATION FILE>
- Outputs to
make migration-protocol D=<MIGRATION NAME>- Outputs to
protocol/migrations/sqlite/<MIGRATION FILE>
- Outputs to
Sorry to leave this hanging, I didn't notice the email with @Samyoul's reply and just now thought to check back on this PR.
@Samyoul I'm happy to add the .up.sql suffix. When I created the file at the time, I saw there was already a file named 1628280060_create-usermessages-index.sql (lacking the suffix) and it was picked up by the migrator, so I named mine similarly since it likewise only deals with an index.
Should I rename both files so they end with .up.sql or only mine?
Hey @michaelsbradleyjr that's interesting. Are you able to see that the new indexes are created? I can see that make generate picks up the migration file to create a comm, but without the .up.sql suffix the migrator can't know if a migration is up or down.
I've checked this migration and the one you mention directly in the db, it isn't being picked up.
Are you able to see that the new indexes are created?
No, actually! Good catch.
I had conflated seeing the incorrect index added in 1625762506_add_deleted_messages.up.sql (in a command-line dump of the schema) with the index added in 1628280060_create-usermessages-index.sql.
So I should change the name of 1628280060_create-usermessages-index.sql to 1628280060_create-usermessages-index.up.sql and 1631129360_fix-deletedmessages-index.sql to 1631129360_fix-deletedmessages-index.up.sql, and that's it?
So I should change the name of 1628280060_create-usermessages-index.sql to 1628280060_create-usermessages-index.up.sql and 1631129360_fix-deletedmessages-index.sql to 1631129360_fix-deletedmessages-index.up.sql, and that's it?
Yes, that should be enough for the migrator to pick up the new migrations
Done!
@michaelsbradleyjr is PR still relevant?