Skip to content

make fields startDate, endDate, memberRate and customerRate optional #86

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

Conversation

imcaizheng
Copy link
Contributor

@imcaizheng imcaizheng commented Dec 28, 2020

Notes

Copy link
Contributor

@maxceem maxceem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@imcaizheng the changes look good and I've already merged ES processor changes.

Though for this change we would also need a DB migration script, otherwise we are getting error like:

ERROR : null value in column "start_date" violates not-null constraint

Let's use Sequalize migrations for this:

  • https://sequelize.org/master/manual/migrations.html
  • create folder migrations where we would put all migrations scripts
  • create a migration script to make these fields optional
  • create npm commands like:
    "migrate": "./node_modules/.bin/sequelize db:migrate",
    "migrate:undo": "./node_modules/.bin/sequelize db:migrate:undo",
    

I would update the budget for this issue to cover this.

Copy link
Contributor

@maxceem maxceem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@imcaizheng all works good.

The only one thing we can improve is to use ENV variable for DB configuration instead of hardcoded values, because we cannot add to config real DB passwords.

Let's use process.env.NEV_VARIABLE_NAME in config, as suggested in docs https://monosnap.com/file/CsG9bjBfpDKUn6Bfz3Cwskee6e3IQk:

  • DB_USERNAME
  • DB_PASSWORD
  • DB_NAME
  • DB_HOST

We can use the same variable names for all environments.

@imcaizheng
Copy link
Contributor Author

@maxceem Fixed.

Copy link
Contributor

@maxceem maxceem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @imcaizheng. All good.

I would wait for Nkumar to come back on Wednesday before merging this PR as I would need his help to run the migration.

@nkumar-topcoder nkumar-topcoder merged commit 8821b54 into topcoder-platform:dev Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants