From 60918800b39fbfe8b194eae92a3e7a59208bedd3 Mon Sep 17 00:00:00 2001 From: Tom Bloor Date: Thu, 20 Jul 2017 17:16:24 +0100 Subject: [PATCH] Added initialisation of Leaderboards to DH --- .../_common/deploy/_any/100-leaderboards.pl | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 share/ddl/_common/deploy/_any/100-leaderboards.pl diff --git a/share/ddl/_common/deploy/_any/100-leaderboards.pl b/share/ddl/_common/deploy/_any/100-leaderboards.pl new file mode 100644 index 0000000..b8af78d --- /dev/null +++ b/share/ddl/_common/deploy/_any/100-leaderboards.pl @@ -0,0 +1,24 @@ +#! perl + +use strict; +use warnings; + +use DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::ScriptHelpers + 'schema_from_schema_loader'; + +schema_from_schema_loader({ naming => 'v7' }, sub { + my $schema = shift; + + $schema->resultset('Leaderboard')->populate([ + [ qw/ name type / ], + [ 'Daily Total', 'daily_total' ], + [ 'Daily Count', 'daily_count' ], + [ 'Weekly Total', 'weekly_total' ], + [ 'Weekly Count', 'weekly_count' ], + [ 'Monthly Total', 'monthly_total' ], + [ 'Monthly Count', 'monthly_count' ], + [ 'All Time Total', 'all_time_total' ], + [ 'All Time Count', 'all_time_count' ], + ]); + +});