Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
BCarcasi committed Mar 21, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 0aa2803 + 2c5f19d commit 45b4ac5
Showing 5 changed files with 265 additions and 109 deletions.
64 changes: 32 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@prisma/client": "^5.6.0",
"@prisma/client": "^5.10.2",
"@types/node": "20.6.5",
"@types/react": "18.2.22",
"@types/react-dom": "18.2.7",
@@ -21,6 +21,6 @@
"typescript": "5.2.2"
},
"devDependencies": {
"prisma": "^5.3.1"
"prisma": "^5.10.2"
}
}
126 changes: 126 additions & 0 deletions prisma/migrations/20240229223743_kids_u/migration.sql
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 prisma/migrations/20240307215802_updated_fields/migration.sql
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;
153 changes: 78 additions & 75 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
provider = "prisma-client-js"
}
@@ -11,97 +8,103 @@ datasource db {
}

model Constituent {
ConstituentID String @id @default(uuid())
Name String
Address String
EmailAddress String?
PhoneNumber String?
CompanySchoolName String?
volunteers Volunteer[]
donors Donor[]
organizations Organization[]
ConstituentID String @id @default(uuid())
FirstName String
LastName String
StreetAddress String
City String
State String
Zipcode String
Country String
EmailAddress String?
PhoneNumber String?
CompanySchoolName String?
donors Donor[]
organizations Organization[]
volunteers Volunteer[]
}

model Volunteer {
VolunteerID String @id @default(uuid())
DOB DateTime
Age Int
EmergencyContact String?
EventsAttended String[]
AgreementToMediaUse Boolean?
TrainingCompletion String?
Constituent Constituent[]
ConstituentID String[]
VolunteerEvents VolunteerEvent[]
VolunteerID String @id @default(uuid())
DOB DateTime
Age Int
EmergencyContact String?
EventsAttended String[]
AgreementToMediaUse Boolean?
TrainingCompletion String?
BackgroundCheckCompletion Boolean?
ConstituentID String
Constituent Constituent @relation(fields: [ConstituentID], references: [ConstituentID])
VolunteerEvents VolunteerEvent[]
}

model Donor {
DonorID String @id @default(uuid())
ContactPreference String?
NotesResources String?
Constituent Constituent @relation(fields: [ConstituentID], references: [ConstituentID])
ConstituentID String
donations Donation[]
DonorID String @id @default(uuid())
ContactPreference String?
NotesResources String?
ConstituentID String
donations Donation[]
Constituent Constituent @relation(fields: [ConstituentID], references: [ConstituentID])
}

model Donation {
DonationID String @id @default(uuid())
AmountDonated Float
DateReceived DateTime
FundingAreas String[]
KidsUPrograms String[]
DueDate DateTime?
Donor Donor @relation(fields: [DonorID], references: [DonorID])
DonorID String
DonationID String @id @default(uuid())
AmountDonated Float
DateReceived DateTime
FundingAreas String[]
KidsUPrograms String[]
DueDate DateTime?
DonorID String
Donor Donor @relation(fields: [DonorID], references: [DonorID])
}

model Organization {
OrganizationID Int @id @default(autoincrement())
PositionInCompany String?
WebsiteForFunder String?
PortalForGrantApplication String?
NotesAboutLoginInfo String?
Constituent Constituent @relation(fields: [ConstituentID], references: [ConstituentID])
ConstituentID String
grants Grant[]
OrganizationID Int @id @default(autoincrement())
PositionInCompany String?
WebsiteForFunder String?
PortalForGrantApplication String?
NotesAboutLoginInfo String?
ConstituentID String
grants Grant[]
Constituent Constituent @relation(fields: [ConstituentID], references: [ConstituentID])
}

model Grant {
GrantID Int @id @default(autoincrement())
GrantName String
Years Int
FundingAreas String[]
KidsUProgram String[]
GrantOpeningDates DateTime[]
AskDate DateTime?
AwardDate DateTime?
ReportingDates DateTime[]
TypeOfReporting String?
DateToReapplyForGrant DateTime?
WaitingPeriodToReapply Int?
FundingRestrictions String?
AskAmount Float
AmountAwarded Float
EndOfGrantReportDueDate DateTime
Organization Organization @relation(fields: [OrganizationID], references: [OrganizationID])
OrganizationID Int
GrantID Int @id @default(autoincrement())
GrantName String
Years Int
FundingAreas String[]
KidsUProgram String[]
GrantOpeningDates DateTime[]
AskDate DateTime?
AwardDate DateTime?
ReportingDates DateTime[]
TypeOfReporting String?
DateToReapplyForGrant DateTime?
WaitingPeriodToReapply Int?
FundingRestrictions String?
AskAmount Float
AmountAwarded Float
EndOfGrantReportDueDate DateTime
OrganizationID Int
Organization Organization @relation(fields: [OrganizationID], references: [OrganizationID])
}

model Event {
EventID Int @id @default(autoincrement())
NameOfEvent String
Date DateTime
Time DateTime
VolunteersAttended VolunteerEvent[]
EventID Int @id @default(autoincrement())
NameOfEvent String
Date DateTime
Time DateTime
VolunteersAttended VolunteerEvent[]
}

model VolunteerEvent {
ID Int @id @default(autoincrement())
Volunteer Volunteer @relation(fields: [VolunteerID], references: [VolunteerID])
VolunteerID String
Event Event @relation(fields: [EventID], references: [EventID])
EventID Int
LoginTime DateTime
LogoutTime DateTime
LoggedHours Int
ID Int @id @default(autoincrement())
VolunteerID String
EventID Int
LoginTime DateTime
LogoutTime DateTime
LoggedHours Int
Event Event @relation(fields: [EventID], references: [EventID])
Volunteer Volunteer @relation(fields: [VolunteerID], references: [VolunteerID])
}

0 comments on commit 45b4ac5

Please sign in to comment.