- cond_create_dbtable($dbh, 'DailyStat', $daily_stat_ctablecmd);
- cond_create_dbtable($dbh, 'DomainStat', $domain_stat_ctablecmd);
- cond_create_dbtable($dbh, 'StatInfo', $statinfo_ctablecmd);
- cond_create_dbtable($dbh, 'CMailStore', $cmailstore_ctablecmd);
- cond_create_dbtable($dbh, 'UserPrefs', $userprefs_ctablecmd);
- cond_create_dbtable($dbh, 'CGreylist', $cgreylist_ctablecmd);
- cond_create_dbtable($dbh, 'CStatistic', $cstatistic_ctablecmd);
- cond_create_dbtable($dbh, 'ClusterInfo', $clusterinfo_ctablecmd);
- cond_create_dbtable($dbh, 'VirusInfo', $virusinfo_stat_ctablecmd);
+ my $tables = {
+ 'DailyStat'=> $daily_stat_ctablecmd,
+ 'DomainStat', $domain_stat_ctablecmd,
+ 'StatInfo', $statinfo_ctablecmd,
+ 'CMailStore', $cmailstore_ctablecmd,
+ 'UserPrefs', $userprefs_ctablecmd,
+ 'CGreylist', $cgreylist_ctablecmd,
+ 'CStatistic', $cstatistic_ctablecmd,
+ 'ClusterInfo', $clusterinfo_ctablecmd,
+ 'VirusInfo', $virusinfo_stat_ctablecmd,
+ };
+
+ foreach my $table (keys %$tables) {
+ cond_create_dbtable($dbh, $table, $tables->{$tables});
+ }