Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
corps-directory
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fhurtado14
corps-directory
Commits
50133a5c
Commit
50133a5c
authored
5 months ago
by
kainguyen
Browse files
Options
Downloads
Plain Diff
Merge branch 'main' of git.cs.vt.edu:fhurtado14/corps-directory
parents
2a2b1d9f
359178cc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
backend/config/database/schema.sql
+95
-0
95 additions, 0 deletions
backend/config/database/schema.sql
with
95 additions
and
0 deletions
backend/config/database/schema.sql
+
95
−
0
View file @
50133a5c
...
...
@@ -21,3 +21,98 @@ CREATE TABLE userLoginLogout (
eventType
VARCHAR
(
255
)
NOT
NULL
,
-- successfulLogin, unsuccessfulLogin, logout
FOREIGN
KEY
(
userID
)
REFERENCES
users
(
userID
)
);
CREATE
TABLE
degreeTypeLookup
(
degreeTypeId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
degreeType
ENUM
(
'AS'
,
'BS'
,
'MS'
,
'PhD'
)
);
CREATE
TABLE
involvementType
(
involvementTypeId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
description
VARCHAR
(
255
)
NOT
NULL
);
CREATE
TABLE
stateLookup
(
stateId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
name
VARCHAR
(
255
)
NOT
NULL
);
CREATE
TABLE
countryLookup
(
countryId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
name
VARCHAR
(
255
)
NOT
NULL
);
CREATE
TABLE
address
(
addressId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
address1
VARCHAR
(
255
)
NOT
NULL
,
address2
VARCHAR
(
255
),
city
VARCHAR
(
255
)
NOT
NULL
,
stateId
INT
,
countryId
INT
,
zipCode
VARCHAR
(
20
)
NOT
NULL
,
FOREIGN
KEY
(
stateId
)
REFERENCES
stateLookup
(
stateId
),
FOREIGN
KEY
(
countryId
)
REFERENCES
countryLookup
(
countryId
)
);
CREATE
TABLE
people
(
peopleId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
firstName
VARCHAR
(
255
)
NOT
NULL
,
lastName
VARCHAR
(
255
)
NOT
NULL
,
middleName
VARCHAR
(
255
),
suffix
VARCHAR
(
32
),
nickName
VARCHAR
(
255
),
techAlumniChapter
INT
,
classYear
VARCHAR
(
16
)
NOT
NULL
,
gradYear
VARCHAR
(
16
),
gradSemester
ENUM
(
'fall'
,
'winter'
,
'spring'
,
'summer'
),
gender
ENUM
(
'male'
,
'female'
,
'other'
)
);
CREATE
TABLE
peopleDegree
(
peopleDegreeId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
peopleId
INT
,
degreeSubject
VARCHAR
(
255
),
degreeTypeId
INT
,
degreeYear
VARCHAR
(
16
),
degreeDescription
VARCHAR
(
255
),
FOREIGN
KEY
(
peopleId
)
REFERENCES
people
(
peopleId
),
FOREIGN
KEY
(
degreeTypeId
)
REFERENCES
degreeTypeLookup
(
degreeTypeId
)
);
CREATE
TABLE
chapterLookup
(
chapterId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
name
VARCHAR
(
255
)
NOT
NULL
);
CREATE
TABLE
peopleXAddress
(
peopleId
INT
PRIMARY
KEY
,
addressId
INT
UNIQUE
,
preferredAddress
VARCHAR
(
255
)
NOT
NULL
,
FOREIGN
KEY
(
peopleId
)
REFERENCES
people
(
peopleId
),
FOREIGN
KEY
(
addressId
)
REFERENCES
address
(
addressId
)
);
CREATE
TABLE
peopleContact
(
peopleContactId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
peopleId
INT
,
contactNumber
VARCHAR
(
255
)
NOT
NULL
,
contactType
VARCHAR
(
50
)
NOT
NULL
,
preferredContact
BOOLEAN
NOT
NULL
DEFAULT
FALSE
,
FOREIGN
KEY
(
peopleId
)
REFERENCES
people
(
peopleId
)
);
CREATE
TABLE
involvementLookup
(
involvementId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
involvementType
INT
,
FOREIGN
KEY
(
involvementType
)
REFERENCES
involvementType
(
involvementTypeId
)
);
CREATE
TABLE
peopleXInvolvement
(
peopleId
INT
,
involvementId
INT
,
PRIMARY
KEY
(
peopleId
,
involvementId
),
FOREIGN
KEY
(
peopleId
)
REFERENCES
people
(
peopleId
),
FOREIGN
KEY
(
involvementId
)
REFERENCES
involvementLookup
(
involvementId
)
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment