park-junha / GradPlanner

An automated four-year undergraduate degree scheduler.
http://gradplanner.us
GNU General Public License v3.0
2 stars 0 forks source link

Populate database with all majors #63

Open park-junha opened 4 years ago

park-junha commented 4 years ago

The data.sql file in the backend directory is responsible for inserting all majors to the database. It can be viewed here.

Here is how each major should be added:

  1. In the INSERT INTO MajornEmphasis statement under VALUES, append each major within a single tuple.
  2. In the statement that inserts to Classes under VALUES, append all classes required for that major, with each class within a single tuple.
  3. In the statement that inserts to Prereqs under VALUES, append all pre-requisites for any classes in Classes that require a pre-requisite, with each pre-requisite in a single tuple. If a class has multiple pre-requisites, add them into distinct tuples.
  4. In the statement that inserts to MajorReqs under VALUES, append all classes that are required for a certain major. The RecommendedOrder column is the sorted list which the algorithm searches through when building the four-year plan, with 1 being the first class in that list.

In order to figure out what columns are in which tables, you can try connecting to the database with MySQL Workbench (or with backend.sh -l in the backend/ directory) and run the query DESCRIBE <Table-Name>. Run SHOW tables to see what tables are in the database.

This is a lot of work, so each major can be added in a single branch. For instance, the Finance major can be done in a branch named issue-63/Finance-Major. You can create a new branch from master (you can do this with git checkout master && git pull) on your terminal with git checkout -b issue-63/Finance-Major.

When you are sure you want to finalize your changes and push to GitHub:

  1. git status -- make sure you are on the issue-63/Finance-Major branch (Git will tell you)
  2. git add data.sql
  3. git commit -m "explanation of changes"
  4. git push -u origin issue-63/Finance-Major

If you don't have Git installed, click here to see how.

park-junha commented 4 years ago

ER digram here

Underline: primary key(s) Bold: foreign key(s)