Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make all DB utils utf8-clean

  • Loading branch information...
commit e1a174bdf5b6fbfa1e52d3ecd280b75d7c048b03 1 parent 6c293ec
@davorg authored
Showing with 5 additions and 2 deletions.
  1. +2 −1  bin/dump_cand
  2. +1 −0  bin/listname
  3. +2 −1  bin/load_cand
View
3  bin/dump_cand
@@ -11,6 +11,7 @@ my $file = shift || 'db/candidate.csv';
my $sch = TwittElection::Schema->connect(
"dbi:mysql:database=$ENV{TE_DB}", $ENV{TE_USER}, $ENV{TE_PASS},
+ { mysql_enable_utf8 => 1 },
) or die;
my $cand_rs = $sch->resultset('Candidate');
@@ -19,4 +20,4 @@ open my $fh, '>', $file or die "$!: $file";
while (my $cand = $cand_rs->next) {
say $fh $cand->dump;
-}
+}
View
1  bin/listname
@@ -21,6 +21,7 @@ my %compass = (
my $sch = TwittElection::Schema->connect(
"dbi:mysql:database=$ENV{TE_DB}", $ENV{TE_USER}, $ENV{TE_PASS},
+ { mysql_enable_utf8 => 1 },
) or die;
foreach my $con ($sch->resultset('Constituency')->all) {
View
3  bin/load_cand
@@ -11,6 +11,7 @@ my $file = shift || 'db/candidate.csv';
my $sch = TwittElection::Schema->connect(
"dbi:mysql:database=$ENV{TE_DB}", $ENV{TE_USER}, $ENV{TE_PASS},
+ { mysql_enable_utf8 => 1 },
) or die;
my $con_rs = $sch->resultset('Constituency');
@@ -43,4 +44,4 @@ while (<$fh>) {
twitter => $twitter,
party_id => $par->id,
});
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.