-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: change some sql queries and add 'viewed' field to messages
- Loading branch information
Showing
6 changed files
with
61 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
INSERT INTO chats (user1, user2) | ||
VALUES (2, 1), | ||
(2, 6), | ||
(2, 7), | ||
(2, 8), | ||
(2, 11), | ||
(2, 13), | ||
(2, 16), | ||
(2, 19), | ||
(2, 20); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
INSERT INTO messages (author_id, content, created_at, chat, viewed) | ||
VALUES | ||
(2, 'Olá, como você está?', NOW() - INTERVAL '10 minutes', 1, TRUE), | ||
(1, 'Estou bem, e você?', NOW() - INTERVAL '9 minutes', 1, FALSE), | ||
|
||
(2, 'Oi, tudo certo?', NOW() - INTERVAL '20 minutes', 2, TRUE), | ||
(6, 'Sim, e aí?', NOW() - INTERVAL '19 minutes', 2, FALSE), | ||
|
||
(2, 'E aí, novidades?', NOW() - INTERVAL '30 minutes', 3, TRUE), | ||
(7, 'Nada de novo por aqui.', NOW() - INTERVAL '29 minutes', 3, FALSE), | ||
|
||
(2, 'Como foi o dia?', NOW() - INTERVAL '40 minutes', 4, TRUE), | ||
(8, 'Trabalhei bastante.', NOW() - INTERVAL '39 minutes', 4, FALSE), | ||
|
||
(2, 'Oi!', NOW() - INTERVAL '50 minutes', 5, TRUE), | ||
(11, 'Oi, tudo bem?', NOW() - INTERVAL '49 minutes', 5, FALSE), | ||
|
||
(2, 'Alguma novidade?', NOW() - INTERVAL '1 hour', 6, TRUE), | ||
(13, 'Nada demais.', NOW() - INTERVAL '59 minutes', 6, FALSE), | ||
|
||
(2, 'Oi, tudo certo?', NOW() - INTERVAL '1 hour 10 minutes', 7, TRUE), | ||
(16, 'Tudo sim, e você?', NOW() - INTERVAL '1 hour 9 minutes', 7, FALSE), | ||
|
||
(2, 'Bora marcar algo?', NOW() - INTERVAL '1 hour 20 minutes', 8, TRUE), | ||
(19, 'Bora sim!', NOW() - INTERVAL '1 hour 19 minutes', 8, FALSE), | ||
|
||
(2, 'Bom dia!', NOW() - INTERVAL '1 hour 30 minutes', 9, TRUE), | ||
(20, 'Bom dia! Como vai?', NOW() - INTERVAL '1 hour 29 minutes', 9, FALSE); |