Various Code Improvements #47

Closed
opened 2024-08-20 13:27:22 +00:00 by corbz · 2 comments
Owner

I've reviewed through for areas of code that require improvement, here are some ideas:

  1. One SavedGuild for multiple users.
    • Foreign Key GuildSettings to SavedGuild, drop the guild_id attr.
  2. BigIntegerFields for Discord Snowflake ID's (previously there was a rounding issue with PositiveBigIntegerField in sqlite, investigate)
  3. Use Discord Provided Snowflake ID's as primary keys
  4. Index Foreign Keys
    class SavedGuilds(models.Model):
        # Other fields...
        class Meta:
            indexes = [
                models.Index(fields=['guild_id']),
                models.Index(fields=['added_by']),
            ]
    

These changes will be breaking, naturally, and will require a at least a minor or major version change.

I've reviewed through for areas of code that require improvement, here are some ideas: 1. One `SavedGuild` for multiple users. - Foreign Key `GuildSettings` to `SavedGuild`, drop the `guild_id` attr. 2. `BigIntegerField`s for Discord Snowflake ID's (previously there was a rounding issue with `PositiveBigIntegerField` in sqlite, investigate) 3. Use Discord Provided Snowflake ID's as primary keys 4. Index Foreign Keys ``` class SavedGuilds(models.Model): # Other fields... class Meta: indexes = [ models.Index(fields=['guild_id']), models.Index(fields=['added_by']), ] ``` These changes will be breaking, naturally, and will require a at least a minor or major version change.
corbz added the
enhancement
label 2024-08-20 13:27:22 +00:00
corbz self-assigned this 2024-08-20 13:27:22 +00:00
corbz added this to the PYRSS project 2024-08-20 13:27:22 +00:00
Author
Owner

I will break these down into smaller issues, and lock this one behind the completion of those.

I will break these down into smaller issues, and lock this one behind the completion of those.
corbz added a new dependency 2024-08-20 13:31:05 +00:00
Author
Owner

Completed model rewrite

Completed model rewrite
corbz closed this issue 2024-10-08 08:24:57 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Depends on
Reference: corbz/PYRSS-Website#47
No description provided.