Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize database role schema #35

Open
nathen418 opened this issue Sep 7, 2022 · 0 comments · Fixed by #48
Open

Standardize database role schema #35

nathen418 opened this issue Sep 7, 2022 · 0 comments · Fixed by #48
Assignees

Comments

@nathen418
Copy link
Member

No description provided.

@schiltz3 schiltz3 moved this from Todo to In Progress in CSSC-Bot Project Board Sep 16, 2022
@schiltz3 schiltz3 linked a pull request Sep 16, 2022 that will close this issue
schiltz3 added a commit that referenced this issue Jan 18, 2023
# Migrate database to clean up structure & rewrite database calls to
match

Edit the structure

* CODE => NAME
* TITLE
* INFO
* ~~ROLE_NAME~~
* ~~CHANNEL_NAME~~
* ROLE_ID
* CHANNEL_ID
* ~~UUID~~
* \+ DUPE
* \+ ACTIVE

This amounts to:
* Removing `UUID`, `ROLE_NAME` and `CHANNEL_NAME`.
* Cleaning up `CODE` and replacing it with `NAME`.
* Adding the `DUPE` field to signify if a class is a duplicate.
* Adding `ACTIVE` to specify if the course is being offered that
semester. (Currently, all classes are considered active.)

### Steps to migrate database and discord server
Run `migrateDb` command to migrate the database
Run `CreateChannels` command to update channel names from the database
Run `CreateRoles` command to update role names from the database

# Link to github cards
#33 
#35 
#49 
#50

# Additions

* Add a helper function to create embeds
* Add `migrateDB` command to update the database to the new schema,
update how duplicate codes are handled, and clean all strings.
* Add modified JS Docs to function. (Types are not added since this is
specified in function definitions with typescript)

# Changes

* Change db scheme
* Change role and channel db calls to reflect changes
* Change how duplicate classes are handled
* Use course title and info in channel topics



## Bugfix
* replace all contiguous whitespace with a dash instead of replacing
spaces with a dash
* Replace contiguous dashes with a dash in ROLE_NAME and CHANNEL_NAME
* Trim leading and trailing whitespace from TITLE
* Limit role name and channel name to 100 characters each
* Limit channel topic to 1024 characters each
* Only reply to role selection if role is actually assigned
* Add bottleneck package to limit the bot to 50 API calls per second
* Prefers matching on channel ID's rather than names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

2 participants