
CREATE DATABASE IF NOT EXISTS central_access;
USE central_access;

CREATE TABLE users (
 id INT AUTO_INCREMENT PRIMARY KEY,
 name VARCHAR(100),
 email VARCHAR(150),
 password VARCHAR(255),
 role ENUM('admin','user') DEFAULT 'user'
);

CREATE TABLE apps (
 id INT AUTO_INCREMENT PRIMARY KEY,
 app_name VARCHAR(100),
 app_url VARCHAR(255)
);

CREATE TABLE user_apps (
 user_id INT,
 app_id INT,
 PRIMARY KEY (user_id, app_id)
);
