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

Follow+Notes: Add grant notes tables to database #3200

Open
Tracked by #2960
TylerHendrickson opened this issue Jun 21, 2024 · 1 comment
Open
Tracked by #2960

Follow+Notes: Add grant notes tables to database #3200

TylerHendrickson opened this issue Jun 21, 2024 · 1 comment
Assignees
Labels
collaboration Grant Finder Issues related to the Grant Finder javascript Pull requests that update Javascript code

Comments

@TylerHendrickson
Copy link
Member

TylerHendrickson commented Jun 21, 2024

Subtask of [STORY]: Update 'Status' to 'Follow + Note' feature #2960

Blocked by

N/A

Blocks

Definition of Done

A new Knex migration is added that creates the tables needed for storing user-submitted notes about grants.

Implementation Details

This requires the following new tables to be created:

  • Table grant_notes
    • Columns:
      • id: serial, not null, primary key
      • grant_id: text, not null, foreign key to grants.grant_id
      • user_id: int, not null, foreign key to users.id
      • created_at: timestamp with time zone, not null, default now()
    • Unique index idx_grant_id_user_id on columns (grant_id, user_id)
  • Table grant_notes_revisions
    • Columns:
      • id: serial, not null, primary key
      • grant_note_id: int, not null, foreign key to grant_notes.id
      • created_at: timestamp with time zone, not null, default now()
      • text: text, not null
@TylerHendrickson TylerHendrickson added the javascript Pull requests that update Javascript code label Jun 21, 2024
@TylerHendrickson TylerHendrickson added the Grant Finder Issues related to the Grant Finder label Jun 21, 2024
@ClaireValdivia ClaireValdivia moved this from 🆕 New to 🔖 Ready in Grants Team Agile Planning Jun 21, 2024
@thucdtran thucdtran self-assigned this Jun 23, 2024
@thucdtran thucdtran moved this from 🔖 Ready to 🏗 In progress in Grants Team Agile Planning Jun 23, 2024
@thucdtran thucdtran moved this from 🏗 In progress to 👀 In review in Grants Team Agile Planning Jun 23, 2024
thucdtran added a commit that referenced this issue Jun 23, 2024
Knex documentation says for the unique() function, that useConstraint will use a unique constraint and is default true for postgres when there is no predicate defined.
Issue #3200 specifies that we want a unique index.
Documentation can be found here: https://knexjs.org/guide/schema-builder.html#unique
thucdtran added a commit that referenced this issue Jul 1, 2024
…#3209)

* Create migration to add grant_notes and grant_notes_revisions tables

* Create migration to add grant_notes and grant_notes_revisions tables

* Add useConstraint modifier to the creation of the unique index.

Knex documentation says for the unique() function, that useConstraint will use a unique constraint and is default true for postgres when there is no predicate defined.
Issue #3200 specifies that we want a unique index.
Documentation can be found here: https://knexjs.org/guide/schema-builder.html#unique

* Lint
@ClaireValdivia ClaireValdivia moved this from 👀 In review to ✅ Staging in Grants Team Agile Planning Jul 2, 2024
@ClaireValdivia
Copy link
Contributor

@thucdtran thanks for your work on this! my understanding is that there isn't anything to test on the front-end here for this change - does that sound right to you?

if so, ill plan to just do general testing in staging of core workflows before our next release

@ClaireValdivia ClaireValdivia moved this from ✅ Staging to 🚢 Completed in Grants Team Agile Planning Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
collaboration Grant Finder Issues related to the Grant Finder javascript Pull requests that update Javascript code
Projects
Status: 🚢 Completed
Development

No branches or pull requests

3 participants