Skip to content

Instantly share code, notes, and snippets.

Created October 9, 2014 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/541fd4d47c13b584284b to your computer and use it in GitHub Desktop.
Save anonymous/541fd4d47c13b584284b to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use Mojolicious::Lite;
helper pg => sub { state $pg = Mojo::Pg->new('postgresql://postgres@/test') };
app->pg->migrations->from_this_class->ensure_latest;
app->start;
__DATA__
@@ migrations
-- 1 up
create table foo (bar varchar(255));
-- 1 down
drop table foo;
-- 2 up
create table baz (yada varchar(255));
-- 2 down
drop table baz;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment