REFACTOR: Remove current_stream_title and current_selected_category_id from users table
This commit is contained in:
@@ -215,8 +215,7 @@ def publish_stream():
|
|||||||
|
|
||||||
|
|
||||||
with Database() as db:
|
with Database() as db:
|
||||||
user_info = db.fetchone("""SELECT user_id, username, current_stream_title,
|
user_info = db.fetchone("""SELECT user_id, username, is_live
|
||||||
current_selected_category_id, is_live
|
|
||||||
FROM users
|
FROM users
|
||||||
WHERE stream_key = ?""", (data['stream_key'],))
|
WHERE stream_key = ?""", (data['stream_key'],))
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
-- Sample Data for users
|
-- Sample Data for users
|
||||||
INSERT INTO users (username, password, email, num_followers, stream_key, is_partnered, bio, is_live, is_admin, current_stream_title, current_selected_category_id) VALUES
|
INSERT INTO users (username, password, email, num_followers, stream_key, is_partnered, bio, is_live, is_admin) VALUES
|
||||||
('GamerDude', 'password123', 'gamerdude@example.com', 500, '1234', 0, 'Streaming my gaming adventures!', 1, 0, 'Game On!', 1),
|
('GamerDude', 'password123', 'gamerdude@example.com', 500, '1234', 0, 'Streaming my gaming adventures!', 1, 0),
|
||||||
('MusicLover', 'music4life', 'musiclover@example.com', 1200, '2345', 0, 'I share my favorite tunes.', 1, 0, 'Live Music Jam', 2),
|
('MusicLover', 'music4life', 'musiclover@example.com', 1200, '2345', 0, 'I share my favorite tunes.', 1, 0),
|
||||||
('ArtFan', 'artistic123', 'artfan@example.com', 300, '3456', 0, 'Exploring the world of art.', 1, 0, 'Sketching Live', 3),
|
('ArtFan', 'artistic123', 'artfan@example.com', 300, '3456', 0, 'Exploring the world of art.', 1, 0),
|
||||||
('EduGuru', 'learn123', 'eduguru@example.com', 800, '4567', 0, 'Teaching everything I know.', 1, 0, 'Math Made Easy', 4),
|
('EduGuru', 'learn123', 'eduguru@example.com', 800, '4567', 0, 'Teaching everything I know.', 1, 0),
|
||||||
('SportsStar', 'sports123', 'sportsstar@example.com', 2000, '5678', 0, 'Join me for live sports updates!', 1, 0, 'Sports Highlights', 5);
|
('SportsStar', 'sports123', 'sportsstar@example.com', 2000, '5678', 0, 'Join me for live sports updates!', 1, 0);
|
||||||
|
|
||||||
INSERT INTO users (username, password, email, num_followers, stream_key, is_partnered, bio, is_live, is_admin) VALUES
|
INSERT INTO users (username, password, email, num_followers, stream_key, is_partnered, bio, is_live, is_admin) VALUES
|
||||||
('GamerDude2', 'password123', 'gamerdude3@gmail.com', 3200, '7890', 0, 'Streaming my gaming adventures!', 0, 0),
|
('GamerDude2', 'password123', 'gamerdude3@gmail.com', 3200, '7890', 0, 'Streaming my gaming adventures!', 0, 0),
|
||||||
|
|||||||
@@ -11,9 +11,6 @@ CREATE TABLE users
|
|||||||
is_live BOOLEAN NOT NULL DEFAULT 0,
|
is_live BOOLEAN NOT NULL DEFAULT 0,
|
||||||
bio VARCHAR(1024) DEFAULT 'This user does not have a Bio.',
|
bio VARCHAR(1024) DEFAULT 'This user does not have a Bio.',
|
||||||
is_admin BOOLEAN NOT NULL DEFAULT 0,
|
is_admin BOOLEAN NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
current_stream_title VARCHAR(100) DEFAULT 'Stream',
|
|
||||||
current_selected_category_id INTEGER DEFAULT 1
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SELECT * FROM users;
|
SELECT * FROM users;
|
||||||
|
|||||||
Reference in New Issue
Block a user