big kahuna
This commit is contained in:
60
lib/CW/Migration/03.pm
Normal file
60
lib/CW/Migration/03.pm
Normal file
@@ -0,0 +1,60 @@
|
||||
package CW::Migration::03;
|
||||
|
||||
use Moo;
|
||||
|
||||
extends 'CW::Migration';
|
||||
|
||||
sub id {
|
||||
return 3;
|
||||
}
|
||||
|
||||
sub sql {
|
||||
my $boards = [
|
||||
{
|
||||
id => 't',
|
||||
name => 'Technology',
|
||||
description => 'Programming, computing, hardware discussion'
|
||||
},
|
||||
{
|
||||
id => 'b',
|
||||
name => 'Money',
|
||||
description => 'Finance, money, and business discussion'
|
||||
},
|
||||
{
|
||||
id => 'a',
|
||||
name => 'Art',
|
||||
description => 'Human made art (all forms welcome) discussion'
|
||||
},
|
||||
{
|
||||
id => 's',
|
||||
name => 'Math & Science',
|
||||
description => 'Math and science discussion'
|
||||
},
|
||||
{
|
||||
id => 'g',
|
||||
name => 'Games',
|
||||
description => 'Video, Tabletop, TCG, gaming discussion'
|
||||
},
|
||||
{
|
||||
id => 'm',
|
||||
name => 'Meta',
|
||||
description => 'Discussion about compiled.world'
|
||||
}
|
||||
];
|
||||
|
||||
my $values = join(
|
||||
",",
|
||||
map {
|
||||
"('"
|
||||
. $_->{id} . "', '"
|
||||
. $_->{name} . "', '"
|
||||
. $_->{description} . "')"
|
||||
} @$boards
|
||||
);
|
||||
my $sql =
|
||||
'INSERT INTO boards (id, name, description) VALUES ' . $values . ';';
|
||||
|
||||
return $sql;
|
||||
}
|
||||
|
||||
1;
|
||||
Reference in New Issue
Block a user