#
# Das globale Verzeichnis der Postfix-Konfiguration
#postfixdir: '/etc/postfix'
+#
+# Datenbank-Konfiguration
+#schema_class: 'FrBr::Postffix::Db'
+'Model::Schema':
+ connect_info:
+ dsn: 'DBI:mysql:database=vmail;host=localhost'
+ user: 'vmail'
+ password: ~
return dir->new( '/etc/postfix' );
}
+#---------------------------------------------------------------------------
+
+# Ändern der Eigenschaften einiger geerbter Attribute
+
+#############################################################################################
+
+=head1 Überschriebene Build-Methoden
+
+=cut
+
+#------
+
+=head2 _build_default_config( )
+
+=cut
+
+sub _build_default_config {
+ return {
+ postfix_dir => '/etc/postfix',
+ 'Model::Schema' => {
+ 'schema_class' => 'FrBr::Postfix::Db',
+ 'connect_info' => {
+ 'dsn' => 'DBI:mysql:database=vmail;host=localhost',
+ 'user' => 'vmail',
+ 'password' => undef,
+ 'AutoCommit' => 1,
+ 'PrintError' => 0,
+ 'RaiseError' => 0,
+ 'quote_char' => '`',
+ 'name_sep' => '.',
+ 'on_connect_do' => [
+ "SET NAMES 'utf8'",
+ ],
+ },
+ },
+ };
+}
+
###########################################################################
=head1 METHODS
}
}
+ if ( $key =~ /^schema[-_]?class$/i and not $self->config->{'schema_class'} ) {
+ $self->config->{'schema_class'} = $val;
+ }
+
}
unless ( $self->postfix_dir->is_absolute ) {
}
+ $self->init_db_schema();
+
};
#---------------------------------
--- /dev/null
+package FrBr::Postfix::Db;
+
+# $Id$
+# $URL$
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Schema';
+
+__PACKAGE__->load_namespaces;
+#__PACKAGE__->load_classes;
+
+1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :
--- /dev/null
+package FrBr::Postfix::Db::Result::Alias;
+
+# $Id$
+# $URL$
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+
+__PACKAGE__->load_components("Core");
+__PACKAGE__->table("alias");
+__PACKAGE__->add_columns(
+ "id" => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+ "alias" => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 128, },
+ "destination" => { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 128, },
+ "enabled" => { data_type => "ENUM", default_value => 'y', is_nullable => 0, size => 1, },
+ "changed_at" => { data_type => "TIMESTAMP", default_value => undef, is_nullable => 0, size => 19, },
+);
+
+__PACKAGE__->set_primary_key("id");
+
+1;
+
+__END__
+
+# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab :