summaryrefslogtreecommitdiffstats
path: root/sql/_common/upgrade
diff options
context:
space:
mode:
Diffstat (limited to 'sql/_common/upgrade')
-rw-r--r--sql/_common/upgrade/3-4/002-convert_users.pl31
1 files changed, 0 insertions, 31 deletions
diff --git a/sql/_common/upgrade/3-4/002-convert_users.pl b/sql/_common/upgrade/3-4/002-convert_users.pl
deleted file mode 100644
index 9631345..0000000
--- a/sql/_common/upgrade/3-4/002-convert_users.pl
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/env perl
-use v5.20;
-use warnings;
-
-use DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::ScriptHelpers 'schema_from_schema_loader';
-use Authen::Passphrase::RejectAll;
-
-schema_from_schema_loader({ naming => 'v4' }, sub {
- my ($schema, $versions) = @_;
-
- while (my ($name, $user) = each %{ $::users->{person} }) {
- my %flags;
- for my $flag (split(//, $user->{flags})) {
- $flags{$flag} = 1;
- }
- $schema->resultset('Users')->create({
- name => $name,
- # We don't have the manually adjusted schema, so we need to
- # pass the raw value for the passphrase column
- passphrase => Authen::Passphrase::RejectAll->new->as_rfc2307,
- flag_secret => $flags{s} // 0,
- flag_admin => $flags{a} // 0,
- flag_hilights => $flags{h} // 0,
- flag_debug => $flags{d} // 0,
- flag_plugin => $flags{p} // 0,
- });
- }
-
- say "NOTE: The data from users.json has been moved to the database.\n"
- . "You may remove users.json now, although keeping a backup is strongly recommended.";
- })