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
a0609154
Commit
a0609154
authored
5 months ago
by
Federico Hurtado
Browse files
Options
Downloads
Patches
Plain Diff
Change sql to not create tables if they do not exist anymore.
parent
50133a5c
No related branches found
Branches containing commit
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
+15
-15
15 additions, 15 deletions
backend/config/database/schema.sql
with
15 additions
and
15 deletions
backend/config/database/schema.sql
+
15
−
15
View file @
a0609154
-- Roles permissions table
CREATE
TABLE
rolesPermissions
(
CREATE
TABLE
IF
NOT
EXISTS
rolesPermissions
(
roleID
INT
PRIMARY
KEY
,
permissionLevel
VARCHAR
(
255
)
NOT
NULL
,
permissionLevelDescription
VARCHAR
(
255
)
NOT
NULL
);
-- Users table (Users are the login profiles for people)
CREATE
TABLE
users
(
CREATE
TABLE
IF
NOT
EXISTS
users
(
userID
INT
AUTO_INCREMENT
PRIMARY
KEY
,
username
VARCHAR
(
255
)
NOT
NULL
,
roleID
INT
NOT
NULL
,
...
...
@@ -14,7 +14,7 @@ CREATE TABLE users (
);
-- Table to log login/logout information
CREATE
TABLE
userLoginLogout
(
CREATE
TABLE
IF
NOT
EXISTS
userLoginLogout
(
eventId
INT
AUTO_INCREMENT
PRIMARY
KEY
,
eventTimestamp
TIMESTAMP
DEFAULT
CURRENT_TIMESTAMP
,
userID
INT
NOT
NULL
,
...
...
@@ -24,27 +24,27 @@ CREATE TABLE userLoginLogout (
CREATE
TABLE
degreeTypeLookup
(
CREATE
TABLE
IF
NOT
EXISTS
degreeTypeLookup
(
degreeTypeId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
degreeType
ENUM
(
'AS'
,
'BS'
,
'MS'
,
'PhD'
)
);
CREATE
TABLE
involvementType
(
CREATE
TABLE
IF
NOT
EXISTS
involvementType
(
involvementTypeId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
description
VARCHAR
(
255
)
NOT
NULL
);
CREATE
TABLE
stateLookup
(
CREATE
TABLE
IF
NOT
EXISTS
stateLookup
(
stateId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
name
VARCHAR
(
255
)
NOT
NULL
);
CREATE
TABLE
countryLookup
(
CREATE
TABLE
IF
NOT
EXISTS
countryLookup
(
countryId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
name
VARCHAR
(
255
)
NOT
NULL
);
CREATE
TABLE
address
(
CREATE
TABLE
IF
NOT
EXISTS
address
(
addressId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
address1
VARCHAR
(
255
)
NOT
NULL
,
address2
VARCHAR
(
255
),
...
...
@@ -56,7 +56,7 @@ CREATE TABLE address (
FOREIGN
KEY
(
countryId
)
REFERENCES
countryLookup
(
countryId
)
);
CREATE
TABLE
people
(
CREATE
TABLE
IF
NOT
EXISTS
people
(
peopleId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
firstName
VARCHAR
(
255
)
NOT
NULL
,
lastName
VARCHAR
(
255
)
NOT
NULL
,
...
...
@@ -70,7 +70,7 @@ CREATE TABLE people (
gender
ENUM
(
'male'
,
'female'
,
'other'
)
);
CREATE
TABLE
peopleDegree
(
CREATE
TABLE
IF
NOT
EXISTS
peopleDegree
(
peopleDegreeId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
peopleId
INT
,
degreeSubject
VARCHAR
(
255
),
...
...
@@ -81,12 +81,12 @@ CREATE TABLE peopleDegree (
FOREIGN
KEY
(
degreeTypeId
)
REFERENCES
degreeTypeLookup
(
degreeTypeId
)
);
CREATE
TABLE
chapterLookup
(
CREATE
TABLE
IF
NOT
EXISTS
chapterLookup
(
chapterId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
name
VARCHAR
(
255
)
NOT
NULL
);
CREATE
TABLE
peopleXAddress
(
CREATE
TABLE
IF
NOT
EXISTS
peopleXAddress
(
peopleId
INT
PRIMARY
KEY
,
addressId
INT
UNIQUE
,
preferredAddress
VARCHAR
(
255
)
NOT
NULL
,
...
...
@@ -94,7 +94,7 @@ CREATE TABLE peopleXAddress (
FOREIGN
KEY
(
addressId
)
REFERENCES
address
(
addressId
)
);
CREATE
TABLE
peopleContact
(
CREATE
TABLE
IF
NOT
EXISTS
peopleContact
(
peopleContactId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
peopleId
INT
,
contactNumber
VARCHAR
(
255
)
NOT
NULL
,
...
...
@@ -103,13 +103,13 @@ CREATE TABLE peopleContact (
FOREIGN
KEY
(
peopleId
)
REFERENCES
people
(
peopleId
)
);
CREATE
TABLE
involvementLookup
(
CREATE
TABLE
IF
NOT
EXISTS
involvementLookup
(
involvementId
INT
PRIMARY
KEY
AUTO_INCREMENT
,
involvementType
INT
,
FOREIGN
KEY
(
involvementType
)
REFERENCES
involvementType
(
involvementTypeId
)
);
CREATE
TABLE
peopleXInvolvement
(
CREATE
TABLE
IF
NOT
EXISTS
peopleXInvolvement
(
peopleId
INT
,
involvementId
INT
,
PRIMARY
KEY
(
peopleId
,
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