- Redesigned the main page with a modern look and feel. - Added search and filtering functionality for drills. - Implemented pagination for browsing drills. - Added the ability for users to mark drills as favorites.
20 lines
677 B
SQL
20 lines
677 B
SQL
-- Create the teams table
|
|
CREATE TABLE IF NOT EXISTS teams (
|
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
|
name VARCHAR(255) NOT NULL,
|
|
owner_user_id INT NOT NULL,
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
FOREIGN KEY (owner_user_id) REFERENCES users(id) ON DELETE CASCADE
|
|
);
|
|
|
|
-- Create the team_members table
|
|
CREATE TABLE IF NOT EXISTS team_members (
|
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
|
team_id INT NOT NULL,
|
|
user_id INT NOT NULL,
|
|
joined_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
FOREIGN KEY (team_id) REFERENCES teams(id) ON DELETE CASCADE,
|
|
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
|
|
UNIQUE KEY (team_id, user_id)
|
|
);
|