amycommits / civic_hacking_hub

A place where people can find nonprofits to code for.
2 stars 13 forks source link

Seed the through table with data #74

Open amycommits opened 3 years ago

amycommits commented 3 years ago

This depends on https://github.com/duaimei/civic_hacking_hub/issues/72

In the server/db/seeds/development/projects.js file also insert the newList into the newest table: code_project_nonprofits

The code will be chained here with a "then": https://github.com/duaimei/civic_hacking_hub/blob/dev/server/db/seeds/development/projects.js#L48

If you query the projects table by project name from the newList, you will receive the id (project_id), code_organization_id and nonprofit_organization_id.

potential gotchas:

async weirdness

tips:

There is a README in the db folder that has the knex commands for running migrations, and seeding databases. https://github.com/duaimei/civic_hacking_hub/tree/dev/server/db (look at it locally, it isn't formatted correctly on github)

rtkimz commented 3 years ago

You can fix (I can if you assign me the issue) the formatting of the README if you use proper Github Markdown like this:

new migration:

run migrations

docs

amycommits commented 3 years ago

@rtkimz I assigned this to you. Please let me know if you need any help with creating the seed!