You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
CREATE TABLE messages (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50) NOT NULL,
email VARCHAR(50) NOT NULL,
subject VARCHAR(100) NOT NULL,
message TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) NOT NULL UNIQUE,
password VARCHAR(100) NOT NULL,
role ENUM('admin', 'user') DEFAULT 'user',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
GRANT ALL PRIVILEGES ON portfolio.* TO 'your_username'@'localhost' IDENTIFIED BY 'your_password';
This database schema includes the following tables:
1. `projects`: Stores information about the projects, including the title, description, image, and technologies used.
2. `messages`: Stores the contact form submissions, including the name, email, subject, and message.
3. `users`: Stores user information, including the username, password, and role (admin or user).
The schema also includes the necessary indexes, timestamps, and access privileges for the database. You can customize the table and column names, data types, and other settings as per your requirements.