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

Update Event model to contain a status field #408

Closed
Caleb-Cohen opened this issue May 9, 2023 · 8 comments
Closed

Update Event model to contain a status field #408

Caleb-Cohen opened this issue May 9, 2023 · 8 comments

Comments

@Caleb-Cohen
Copy link
Member

Related Issues
Project: Admin Dashboard
Depends on: TBD*

Description
Add status to Events.js model
status should be a string with default of pending & required of true
Create a function to update all current event objects to have status field. Set as active.

Acceptance Criteria

  • All current objects and any object added has a status: pending Key value.

*Ticket on hold to discuss how to test without messing with production data.

@guel-codes
Copy link
Contributor

I might have this done. But wanted to get clarification about the function that was mentioned. Are you looking for a function to update the documents that are already in the database with the status field? If so, I have a script that we should be able to use for that to do it all at once.

@Caleb-Cohen
Copy link
Member Author

I might have this done. But wanted to get clarification about the function that was mentioned. Are you looking for a function to update the documents that are already in the database with the status field? If so, I have a script that we should be able to use for that to do it all at once.

Good question. This was part of the reason why it's on hold. I'm unfamiliar with in what order this should be done.

@guel-codes
Copy link
Contributor

Since the status field isn't actually being used yet. We could update existing events first and then right after that merge this in. We can discuss this more, but you could create temporary user in mongo with access to that specific collection then I can use that connection string to insert the field with the default pending value.

@Caleb-Cohen
Copy link
Member Author

Caleb-Cohen commented May 22, 2023

Since the status field isn't actually being used yet. We could update existing events first and then right after that merge this in. We can discuss this more, but you could create temporary user in mongo with access to that specific collection then I can use that connection string to insert the field with the default pending value.

How would the existing events be updated? You mentioned a script, is that script executed outside of the codebase?

@guel-codes
Copy link
Contributor

Yea it would run outside of the current codebase. I have a Python script that can connect to the database, query for all docs where the status field is missing(currently all of them) and then add the status field with the default value.

@Caleb-Cohen
Copy link
Member Author

Yea it would run outside of the current codebase. I have a Python script that can connect to the database, query for all docs where the status field is missing(currently all of them) and then add the status field with the default value.

Ok, I think we should start with that then. Is there any sort of testing that needs to be done prior to attempting this on production data, can we backup the DB?

@guel-codes
Copy link
Contributor

We can test it on a fake collection to make sure it works as it should. There are also back up option in Mongo so we can take a snapshot before we run the script to preserve the data at that point in time.

@Caleb-Cohen
Copy link
Member Author

We can test it on a fake collection to make sure it works as it should. There are also back up option in Mongo so we can take a snapshot before we run the script to preserve the data at that point in time.

Hey there, can we setup a time this week to address this?

Caleb-Cohen pushed a commit that referenced this issue Jun 8, 2023
* update to Event model

* linting update

* readding cross-env

* update to the status field default value
@Caleb-Cohen Caleb-Cohen moved this from Todo to Done in Admin Dashboard Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants