about summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-10-03 11:37:07 +0200
committerfranck cuny <franck@lumberjaph.net>2010-10-03 11:37:07 +0200
commitf8980ca9680dcc449919dfa6424fc52ffac9bb93 (patch)
tree950f5d301b3a774fa4462ac03cb65a82f57bcda9
parentremove redis, use dbic instead (diff)
downloadjitterbug-f8980ca9680dcc449919dfa6424fc52ffac9bb93.tar.gz
script to deploy new schema
Diffstat (limited to '')
-rw-r--r--scripts/deploy_schema14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/deploy_schema b/scripts/deploy_schema
new file mode 100644
index 0000000..aa31811
--- /dev/null
+++ b/scripts/deploy_schema
@@ -0,0 +1,14 @@
+use strict;
+use warnings;
+use jitterbug::Schema;
+use YAML qw/LoadFile/;
+
+my $config = shift;
+die "need configuration file" unless $config;
+
+my $dancer_conf = LoadFile($config);
+
+my $dbix_conf = $dancer_conf->{plugins}->{DBIC}->{schema};
+my $schema    = jitterbug::Schema->connect( @{ $dbix_conf->{connect_info} } );
+$schema->deploy;
+print "done!\n";
\ No newline at end of file