mastodon icon indicating copy to clipboard operation
mastodon copied to clipboard

tootcli fix-duplicates bugs

Open shleeable opened this issue 3 years ago • 3 comments

Steps to reproduce the problem

Running the current fix-duplicates toolcli adds the index_tags_on_name_lower index back, even after the mitgrate has removed it.

https://github.com/mastodon/mastodon/blob/b07906bdb0127cd73662506b519183cc51a2758e/lib/mastodon/maintenance_cli.rb#L512

https://github.com/mastodon/mastodon/blob/main/db/migrate/20210421121431_add_case_insensitive_btree_index_to_tags.rb

Expected behaviour

index should be removed

Actual behaviour

index is recreated.

Specifications

main

shleeable avatar Sep 07 '22 04:09 shleeable

Similar issue with index_users_on_remember_token might be n

ERROR:  index "index_users_on_remember_token" does not exist
STATEMENT:  DROP INDEX  "index_users_on_remember_token"

https://github.com/mastodon/mastodon/blob/b07906bdb0127cd73662506b519183cc51a2758e/lib/mastodon/maintenance_cli.rb#L276

Was this deleted here?

https://github.com/mastodon/mastodon/blob/main/db/post_migrate/20220118183123_remove_rememberable_from_users.rb

shleeable avatar Sep 07 '22 04:09 shleeable

for @ClearlyClaire

shleeable avatar Sep 07 '22 04:09 shleeable

Running the current fix-duplicates toolcli adds the index_tags_on_name_lower index back, even after the mitgrate has removed it.

https://github.com/mastodon/mastodon/blob/b07906bdb0127cd73662506b519183cc51a2758e/lib/mastodon/maintenance_cli.rb#L512

https://github.com/mastodon/mastodon/blob/main/db/migrate/20210421121431_add_case_insensitive_btree_index_to_tags.rb

Oops, re-inserting it should have been conditional indeed.

Similar issue with index_users_on_remember_token might be n

ERROR:  index "index_users_on_remember_token" does not exist
STATEMENT:  DROP INDEX  "index_users_on_remember_token"

This is not an error when adding an index, but when attempting to remove it. However, the script should not error out if the index doesn't exist. Can I get more context for this error?

https://github.com/mastodon/mastodon/blob/b07906bdb0127cd73662506b519183cc51a2758e/lib/mastodon/maintenance_cli.rb#L276

Was this deleted here?

https://github.com/mastodon/mastodon/blob/main/db/post_migrate/20220118183123_remove_rememberable_from_users.rb

No, it's deleted in https://github.com/mastodon/mastodon/blob/main/db/post_migrate/20220118183010_remove_index_users_on_remember_token.rb

ClearlyClaire avatar Sep 07 '22 07:09 ClearlyClaire