Skip to content
Snippets Groups Projects
Commit ba1b86ab authored by Federico Hurtado's avatar Federico Hurtado
Browse files

redeploy tables with new schema.

parent 559aa60c
No related branches found
No related tags found
No related merge requests found
DROP TABLE IF EXISTS userLoginLogout;
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS rolesPermissions;
-- Roles permissions table
CREATE TABLE 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 (
userID INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(255) NOT NULL,
roleID INT NOT NULL,
FOREIGN KEY (roleID) REFERENCES rolesPermissions(roleID)
);
-- Table to log login/logout information
CREATE TABLE userLoginLogout (
eventId INT AUTO_INCREMENT PRIMARY KEY,
eventTimestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
userID INT NOT NULL,
eventType VARCHAR(255) NOT NULL, -- successfulLogin, unsuccessfulLogin, logout
FOREIGN KEY (userID) REFERENCES users(userID)
);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment