acm-uiowa / acm-uiowa/uigrades

Refactor: Fix database seeding functions

Offen
#5 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
4
Forks
4
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

The database seeding functions are extremely messy, unoptimized, and hard to read. Refactor these functions.

Additionally, the ability to seed databases is via a function on the admin portal side. Look into `src\app\admin\dashboard\data`, `src\app\admin\dashboard\data\components\SeedDataButton.tsx`, and `src\db\seeds\seed.ts` for more information on how the database is currently being seeded. The admin data page (which was used to seed the database) functionality is tabled and not up-to-date, and loading into the `src\app\admin\dashboard\data` route automatically calls the database seeding script (not good, probably to do with client components). Remove this feature and figure out a way to seed the database using cli scripts (manually is fine since data is received at most once a semester (usually once every two semesters). Add this script to `package.json` under the `scripts` sections, there should already by an empty script for `seed-db` and `clear-db`. Note any modules installed (ts-node, tsx, etc.).

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.