-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge branch 'main' of https://github.com/UTDallasEPICS/Kids-U-Donor-…
Showing
5 changed files
with
265 additions
and
109 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
-- CreateTable | ||
CREATE TABLE "Constituent" ( | ||
"ConstituentID" TEXT NOT NULL, | ||
"Name" TEXT NOT NULL, | ||
"Address" TEXT NOT NULL, | ||
"EmailAddress" TEXT, | ||
"PhoneNumber" TEXT, | ||
"CompanySchoolName" TEXT, | ||
|
||
CONSTRAINT "Constituent_pkey" PRIMARY KEY ("ConstituentID") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Volunteer" ( | ||
"VolunteerID" TEXT NOT NULL, | ||
"DOB" TIMESTAMP(3) NOT NULL, | ||
"Age" INTEGER NOT NULL, | ||
"EmergencyContact" TEXT, | ||
"EventsAttended" TEXT[], | ||
"AgreementToMediaUse" BOOLEAN, | ||
"TrainingCompletion" TEXT, | ||
"ConstituentID" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Volunteer_pkey" PRIMARY KEY ("VolunteerID") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Donor" ( | ||
"DonorID" TEXT NOT NULL, | ||
"ContactPreference" TEXT, | ||
"NotesResources" TEXT, | ||
"ConstituentID" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Donor_pkey" PRIMARY KEY ("DonorID") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Donation" ( | ||
"DonationID" TEXT NOT NULL, | ||
"AmountDonated" DOUBLE PRECISION NOT NULL, | ||
"DateReceived" TIMESTAMP(3) NOT NULL, | ||
"FundingAreas" TEXT[], | ||
"KidsUPrograms" TEXT[], | ||
"DueDate" TIMESTAMP(3), | ||
"DonorID" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Donation_pkey" PRIMARY KEY ("DonationID") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Organization" ( | ||
"OrganizationID" SERIAL NOT NULL, | ||
"PositionInCompany" TEXT, | ||
"WebsiteForFunder" TEXT, | ||
"PortalForGrantApplication" TEXT, | ||
"NotesAboutLoginInfo" TEXT, | ||
"ConstituentID" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Organization_pkey" PRIMARY KEY ("OrganizationID") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Grant" ( | ||
"GrantID" SERIAL NOT NULL, | ||
"GrantName" TEXT NOT NULL, | ||
"Years" INTEGER NOT NULL, | ||
"FundingAreas" TEXT[], | ||
"KidsUProgram" TEXT[], | ||
"GrantOpeningDates" TIMESTAMP(3)[], | ||
"AskDate" TIMESTAMP(3), | ||
"AwardDate" TIMESTAMP(3), | ||
"ReportingDates" TIMESTAMP(3)[], | ||
"TypeOfReporting" TEXT, | ||
"DateToReapplyForGrant" TIMESTAMP(3), | ||
"WaitingPeriodToReapply" INTEGER, | ||
"FundingRestrictions" TEXT, | ||
"AskAmount" DOUBLE PRECISION NOT NULL, | ||
"AmountAwarded" DOUBLE PRECISION NOT NULL, | ||
"EndOfGrantReportDueDate" TIMESTAMP(3) NOT NULL, | ||
"OrganizationID" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "Grant_pkey" PRIMARY KEY ("GrantID") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Event" ( | ||
"EventID" SERIAL NOT NULL, | ||
"NameOfEvent" TEXT NOT NULL, | ||
"Date" TIMESTAMP(3) NOT NULL, | ||
"Time" TIMESTAMP(3) NOT NULL, | ||
|
||
CONSTRAINT "Event_pkey" PRIMARY KEY ("EventID") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "VolunteerEvent" ( | ||
"ID" SERIAL NOT NULL, | ||
"VolunteerID" TEXT NOT NULL, | ||
"EventID" INTEGER NOT NULL, | ||
"LoginTime" TIMESTAMP(3) NOT NULL, | ||
"LogoutTime" TIMESTAMP(3) NOT NULL, | ||
"LoggedHours" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "VolunteerEvent_pkey" PRIMARY KEY ("ID") | ||
); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Volunteer" ADD CONSTRAINT "Volunteer_ConstituentID_fkey" FOREIGN KEY ("ConstituentID") REFERENCES "Constituent"("ConstituentID") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Donor" ADD CONSTRAINT "Donor_ConstituentID_fkey" FOREIGN KEY ("ConstituentID") REFERENCES "Constituent"("ConstituentID") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Donation" ADD CONSTRAINT "Donation_DonorID_fkey" FOREIGN KEY ("DonorID") REFERENCES "Donor"("DonorID") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Organization" ADD CONSTRAINT "Organization_ConstituentID_fkey" FOREIGN KEY ("ConstituentID") REFERENCES "Constituent"("ConstituentID") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Grant" ADD CONSTRAINT "Grant_OrganizationID_fkey" FOREIGN KEY ("OrganizationID") REFERENCES "Organization"("OrganizationID") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "VolunteerEvent" ADD CONSTRAINT "VolunteerEvent_VolunteerID_fkey" FOREIGN KEY ("VolunteerID") REFERENCES "Volunteer"("VolunteerID") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "VolunteerEvent" ADD CONSTRAINT "VolunteerEvent_EventID_fkey" FOREIGN KEY ("EventID") REFERENCES "Event"("EventID") ON DELETE RESTRICT ON UPDATE CASCADE; |
27 changes: 27 additions & 0 deletions
27
prisma/migrations/20240307215802_updated_fields/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `Address` on the `Constituent` table. All the data in the column will be lost. | ||
- You are about to drop the column `Name` on the `Constituent` table. All the data in the column will be lost. | ||
- Added the required column `City` to the `Constituent` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `Country` to the `Constituent` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `FirstName` to the `Constituent` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `LastName` to the `Constituent` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `State` to the `Constituent` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `StreetAddress` to the `Constituent` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `Zipcode` to the `Constituent` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "Constituent" DROP COLUMN "Address", | ||
DROP COLUMN "Name", | ||
ADD COLUMN "City" TEXT NOT NULL, | ||
ADD COLUMN "Country" TEXT NOT NULL, | ||
ADD COLUMN "FirstName" TEXT NOT NULL, | ||
ADD COLUMN "LastName" TEXT NOT NULL, | ||
ADD COLUMN "State" TEXT NOT NULL, | ||
ADD COLUMN "StreetAddress" TEXT NOT NULL, | ||
ADD COLUMN "Zipcode" TEXT NOT NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Volunteer" ADD COLUMN "BackgroundCheckCompletion" BOOLEAN; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters