From fab89aa92e329728b08ee8c7ab4799a700f94070 Mon Sep 17 00:00:00 2001 From: swag Date: Sun, 5 Dec 2021 04:22:55 -0500 Subject: [PATCH] Using under() for the migration didn't make sense --- guestbook-ng.pl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/guestbook-ng.pl b/guestbook-ng.pl index 07ee728..1536ec6 100755 --- a/guestbook-ng.pl +++ b/guestbook-ng.pl @@ -35,11 +35,10 @@ helper message => sub { state $message = GuestbookNg::Model::Message->new(pg => shift->pg) }; -# Routes -under sub ($c) { - $c->pg->migrations->from_dir('migrations')->migrate(1) -}; +# Get the DB ready +app->pg->migrations->from_dir('migrations')->migrate(1); +# Routes get '/' => sub ($c) { my $posts = $c->message->get_posts();