dwyl / github-backup

:octocat: :back: 🆙 Backup your GitHub Issues so you can still work when (they/you are) offline.
https://github-backup.herokuapp.com
GNU General Public License v2.0
32 stars 3 forks source link

Epic: Define (Ecto) PostgreSQL Database Schema #15

Open nelsonic opened 6 years ago

nelsonic commented 6 years ago

All the "Meta Data" (anything that is not an issue comment, which is Markdown/"Rich Text") of issues will be stored in a PostgreSQL Database.

With reference to the GitHub API for users, issues and comments, we need to create the Ecto (Database) Schema for the three DB tables. We are going to "normalise" the data and let Ecto construct the queries.

Our aim is to match the field names in the GitHub API exactly so we keep an exact copy the data that people can easily download if they want to have a Local Copy. (don't worry, we aren't building the download feature yet!)

Cleop commented 6 years ago

Relates to https://github.com/dwyl/github-backup/issues/5

In the long run we might want these two tables to help us display our UI better but for now if people are accessing their comments directly from the issue then they wouldn't be necessary.

Organisations
ID
Organisation name
Repositories
ID
Repo name

Do people think we should include them in our schema now or add them later if necessary?

nelsonic commented 6 years ago

@Cleop if we know the desired schema up-front then we should create it as close to the "long term" as possible.

Cleop commented 6 years ago

Do we need the avatar url in our schema for displaying the user's photo next to their comments? image

nelsonic commented 6 years ago

@Cleop yeah, we should save the "avatar_url". For now please assume we are storing all the info for a user. Thanks.

Cleop commented 6 years ago

Still to do #46