Commit Graph

16 Commits

Author SHA1 Message Date
Natalie Tay 9ce8f3fd53
DEV: Check that setting does not exist before migrate (#203) 2024-08-07 12:55:55 +08:00
Natalie Tay 55970d4d4e
DEV: Fix migration that renamed site settings (#202)
There was a typo here - https://github.com/discourse/discourse-topic-voting/pull/196 - that unfortunately went through.
2024-08-07 11:20:20 +08:00
Natalie Tay 6285bd06a6
DEV: Remove query to make sure topic vote counts are deleted when topics are deleted (#201)
This is now removed automatically when a topic is deleted
2024-08-03 00:16:59 +08:00
Natalie Tay c6b3147e0a
DEV: Avoid subquery in the post migration (#200)
Remove delete votes where there are no users because that cannot happen
2024-08-02 19:13:28 +08:00
Natalie Tay 4ebcd1187b
DEV: Update data explorer queries to new table if exists (#197) 2024-07-18 00:01:48 +08:00
Natalie Tay 3d3037729c
DEV: Scope topic voting tables to avoid confusion with post voting (#196)
Renaming discourse_voting to topic_voting since there are two forms of voting in Discourse - posts and topics.

This PR also moves a OnceOff into a post migration. The post migration will be executed, but should ideally be a no-op. This allows us to not have to maintain the OnceOff as it had to be modified before with a previous migration. I considered removing this file altogether, but I don't think there is anything negative from just converting it into a migration, and it might be useful in the unlikely scenario that a forum from the past has never ran the OnceOff before.
2024-07-17 20:26:40 +08:00
David Taylor 1284196081
DEV: Introduce syntax_tree for ruby formatting (#138) 2022-12-29 13:35:59 +01:00
David Taylor 7f90cfffa7
DEV: Promote historic post-deploy migrations (#96) 2021-06-23 17:34:04 +01:00
Jarek Radosz b92385aada
FIX: Delete the votes on user removal (#59)
There are some assumptions in the code that `vote.user` exists. It makes sense to boop the votes out of existence when their owner is destroyed.
2020-10-06 18:04:26 +02:00
David Taylor 835b3580b7
FIX: Skip migrating null/blank custom field values in migrations 2020-09-09 17:00:56 +01:00
David Taylor 142b3db6b8
FIX: Skip duplicate data when migrating from custom fields 2020-08-17 12:57:55 +01:00
Krzysztof Kotlarek 0f0e76f170
FIX: move data to separate tables (#52)
We are trying to avoid custom tables. Changes:
CategoryCustomField -> DiscourseVoting::CategorySetting # contains infromation if voting is enabled for category
UserCustomField -> DiscourseVoting::Vote # user's votes
TopicCustomField -> DiscourseVoting::VoteCounter # cache count for topics
2020-08-17 15:01:33 +10:00
Penar Musaraj 184478b8c2 Make Rubocop happy 2019-07-29 21:28:47 -04:00
David Taylor fd5c6d91f9 FIX: Reclaim votes when voting is disabled on a category 2019-07-18 16:53:03 +01:00
Penar Musaraj 98790e3caa Fix migration class name 2019-06-25 13:56:32 -04:00
Vinoth Kannan f552e24953 FIX: add unique index for 'vote_count' topic custom fields.
It shouldn't have duplicates else it breaks the code.
2019-06-25 21:17:49 +05:30