Revert back to table name 'messages' for now

This commit is contained in:
swag 2021-12-31 22:49:45 -05:00
parent f50bcce74e
commit 6f06c1292d
4 changed files with 5 additions and 7 deletions

View File

@ -93,7 +93,7 @@ app->secrets(app->config->{'secrets'}) || die $@;
app->message->max_posts(app->config->{'max_posts'}) app->message->max_posts(app->config->{'max_posts'})
if app->config->{'max_posts'}; if app->config->{'max_posts'};
app->pg->migrations->from_dir('migrations')->migrate(4); app->pg->migrations->from_dir('migrations')->migrate(3);
app->asset->store->paths(['assets']); app->asset->store->paths(['assets']);
app->asset->process('swagg.css', 'css/swagg.css'); app->asset->process('swagg.css', 'css/swagg.css');

View File

@ -22,7 +22,7 @@ sub get_posts($self, $this_page = undef) {
SELECT to_char(message_date, 'Dy Mon DD HH:MI:SS AM TZ YYYY'), SELECT to_char(message_date, 'Dy Mon DD HH:MI:SS AM TZ YYYY'),
visitor_name, visitor_name,
message message
FROM guestbook FROM messages
ORDER BY message_date DESC ORDER BY message_date DESC
LIMIT ? OFFSET ?; LIMIT ? OFFSET ?;
END_SQL END_SQL
@ -32,7 +32,7 @@ sub get_posts($self, $this_page = undef) {
SELECT to_char(message_date, 'Dy Mon DD HH:MI:SS AM TZ YYYY'), SELECT to_char(message_date, 'Dy Mon DD HH:MI:SS AM TZ YYYY'),
visitor_name, visitor_name,
message message
FROM guestbook FROM messages
ORDER BY message_date DESC; ORDER BY message_date DESC;
END_SQL END_SQL
} }
@ -40,7 +40,7 @@ sub get_posts($self, $this_page = undef) {
sub create_post($self, $name, $message) { sub create_post($self, $name, $message) {
$self->pg->db->query(<<~'END_SQL', $name, $message) $self->pg->db->query(<<~'END_SQL', $name, $message)
INSERT INTO guestbook (message_date, visitor_name, message) INSERT INTO messages (message_date, visitor_name, message)
VALUES (NOW(), ?, ?); VALUES (NOW(), ?, ?);
END_SQL END_SQL
} }
@ -58,7 +58,7 @@ sub get_last_page($self) {
} }
sub get_post_count($self) { sub get_post_count($self) {
$self->pg->db->query('SELECT count(*) FROM guestbook;')->text() $self->pg->db->query('SELECT count(*) FROM messages;')->text()
} }
1; 1;

View File

@ -1 +0,0 @@
ALTER TABLE guestbook RENAME TO messages;

View File

@ -1 +0,0 @@
ALTER TABLE messages RENAME TO guestbook;