Revert back to table name 'messages' for now
This commit is contained in:
parent
f50bcce74e
commit
6f06c1292d
|
@ -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');
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
ALTER TABLE guestbook RENAME TO messages;
|
|
|
@ -1 +0,0 @@
|
||||||
ALTER TABLE messages RENAME TO guestbook;
|
|
Loading…
Reference in New Issue
Block a user