add Schema::Versioned support

This commit is contained in:
Oliver Gorwits
2012-10-09 22:09:13 +01:00
parent c6a5c69b3e
commit cf8302134d
6 changed files with 970 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
#!/usr/bin/env perl
use strict;
use warnings FATAL => 'all';
use Dancer ':script';
use Dancer::Plugin::DBIC 'schema';
use Netdisco::DB;
use Try::Tiny;
if (not schema->get_db_version()) {
# installs the dbix_class_schema_versions table with version "0"
schema->install("0");
}
# upgrades from whatever dbix_class_schema_versions says, to $VERSION
schema->upgrade();