aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas <skangas@skangas.se>2011-02-09 20:48:21 +0100
committerStefan Kangas <skangas@skangas.se>2011-02-09 20:48:21 +0100
commitd18b13bc64d66df89b2a37aacc8fca22a38dbb23 (patch)
tree404357d7464e938f790d80d7d8804be71029dab5
parentdacc785b452c068322fb2ae35ff1686fca2226e4 (diff)
Added new Schemas for alias, domain, log
-rw-r--r--lib/Fripost/Schema/Result/Alias.pm52
-rw-r--r--lib/Fripost/Schema/Result/Domain.pm51
-rw-r--r--lib/Fripost/Schema/Result/Log.pm49
-rw-r--r--lib/Fripost/Schema/Result/Mailbox.pm4
4 files changed, 154 insertions, 2 deletions
diff --git a/lib/Fripost/Schema/Result/Alias.pm b/lib/Fripost/Schema/Result/Alias.pm
new file mode 100644
index 0000000..ead694f
--- /dev/null
+++ b/lib/Fripost/Schema/Result/Alias.pm
@@ -0,0 +1,52 @@
+package Fripost::Schema::Result::Alias;
+
+use 5.010_000;
+use warnings;
+use strict;
+
+use base qw/DBIx::Class::Core/;
+
+# mysql> describe alias;
+# +-------------+--------------+------+-----+---------------------+-------+
+# | Field | Type | Null | Key | Default | Extra |
+# +-------------+--------------+------+-----+---------------------+-------+
+# | address | varchar(255) | NO | PRI | | |
+# | goto | text | NO | | NULL | |
+# | domain | varchar(255) | NO | | | |
+# | create_date | datetime | NO | | 0000-00-00 00:00:00 | |
+# | change_date | timestamp | NO | | CURRENT_TIMESTAMP | |
+# | active | tinyint(4) | NO | | 1 | |
+# +-------------+--------------+------+-----+---------------------+-------+
+# 6 rows in set (0.00 sec)
+
+__PACKAGE__->load_components(qw/InflateColumn::DateTime/);
+
+__PACKAGE__->table('domain');
+__PACKAGE__->add_columns(qw/ address goto domain create_date change_date active /);
+__PACKAGE__->add_columns(
+ create_date => { data_type => 'datetime', timezone => "Europe/Stockholm", locale => "se_SV" },
+ change_date => { data_type => 'datetime', timezone => "Europe/Stockholm", locale => "se_SV" },
+);
+
+__PACKAGE__->set_primary_key('domain');
+
+=head1 NAME
+
+Fripost::Schema::Result::Alias -
+
+=head1 AUTHOR
+
+Stefan Kangas C<< <skangas at skangas.se> >>
+
+=head1 COPYRIGHT
+
+Copyright 2010,2011 Stefan Kangas, all rights reserved.
+
+=head1 LICENSE
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as perl itself.
+
+=cut
+
+1; # End of Alias.pm
diff --git a/lib/Fripost/Schema/Result/Domain.pm b/lib/Fripost/Schema/Result/Domain.pm
new file mode 100644
index 0000000..36649de
--- /dev/null
+++ b/lib/Fripost/Schema/Result/Domain.pm
@@ -0,0 +1,51 @@
+package Fripost::Schema::Result::Domain;
+
+use 5.010_000;
+use warnings;
+use strict;
+
+use base qw/DBIx::Class::Core/;
+
+# mysql> describe domain;
+# +-------------+--------------+------+-----+---------------------+-------+
+# | Field | Type | Null | Key | Default | Extra |
+# +-------------+--------------+------+-----+---------------------+-------+
+# | domain | varchar(255) | NO | PRI | | |
+# | description | varchar(255) | NO | | | |
+# | create_date | datetime | NO | | 0000-00-00 00:00:00 | |
+# | change_date | timestamp | NO | | CURRENT_TIMESTAMP | |
+# | active | tinyint(4) | NO | | 1 | |
+# +-------------+--------------+------+-----+---------------------+-------+
+# 5 rows in set (0.00 sec)
+
+__PACKAGE__->load_components(qw/InflateColumn::DateTime/);
+
+__PACKAGE__->table('domain');
+__PACKAGE__->add_columns(qw/ domain description create_date change_date active /);
+__PACKAGE__->add_columns(
+ create_date => { data_type => 'datetime', timezone => "Europe/Stockholm", locale => "se_SV" },
+ change_date => { data_type => 'datetime', timezone => "Europe/Stockholm", locale => "se_SV" },
+);
+
+__PACKAGE__->set_primary_key('domain');
+
+=head1 NAME
+
+Fripost::Schema::Result::Domain -
+
+=head1 AUTHOR
+
+Stefan Kangas C<< <skangas at skangas.se> >>
+
+=head1 COPYRIGHT
+
+Copyright 2010, 2011 Stefan Kangas, all rights reserved.
+
+=head1 LICENSE
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as perl itself.
+
+=cut
+
+1; # End of Domain.pm
diff --git a/lib/Fripost/Schema/Result/Log.pm b/lib/Fripost/Schema/Result/Log.pm
new file mode 100644
index 0000000..87fb8d9
--- /dev/null
+++ b/lib/Fripost/Schema/Result/Log.pm
@@ -0,0 +1,49 @@
+package Fripost::Schema::Result::Log;
+
+use 5.010_000;
+use warnings;
+use strict;
+
+use base qw/DBIx::Class::Core/;
+
+# mysql> describe log;
+# +-------+-------------+------+-----+-------------------+----------------+
+# | Field | Type | Null | Key | Default | Extra |
+# +-------+-------------+------+-----+-------------------+----------------+
+# | id | int(11) | NO | PRI | NULL | auto_increment |
+# | user | varchar(20) | NO | | | |
+# | event | text | NO | | NULL | |
+# | date | timestamp | NO | | CURRENT_TIMESTAMP | |
+# +-------+-------------+------+-----+-------------------+----------------+
+# 4 rows in set (0.00 sec)
+
+__PACKAGE__->load_components(qw/InflateColumn::DateTime/);
+
+__PACKAGE__->table('mailbox');
+__PACKAGE__->add_columns(qw/ id user event /);
+__PACKAGE__->add_columns(
+ date => { data_type => 'datetime', timezone => "Europe/Stockholm", locale => "se_SV" },
+);
+
+__PACKAGE__->set_primary_key('id');
+
+=head1 NAME
+
+Fripost::Schema::Result::Log -
+
+=head1 AUTHOR
+
+Stefan Kangas C<< <skangas at skangas.se> >>
+
+=head1 COPYRIGHT
+
+Copyright 2010,2011 Stefan Kangas, all rights reserved.
+
+=head1 LICENSE
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as perl itself.
+
+=cut
+
+1; # End of Log.pm
diff --git a/lib/Fripost/Schema/Result/Mailbox.pm b/lib/Fripost/Schema/Result/Mailbox.pm
index 0932d5c..f12e1f7 100644
--- a/lib/Fripost/Schema/Result/Mailbox.pm
+++ b/lib/Fripost/Schema/Result/Mailbox.pm
@@ -16,7 +16,7 @@ use base qw/DBIx::Class::Core/;
# | maildir | varchar(255) | NO | | | |
# | domain | varchar(255) | NO | | | |
# | create_date | datetime | NO | | 0000-00-00 00:00:00 | |
-# | change_date | datetime | NO | | 0000-00-00 00:00:00 | |
+# | change_date | timestamp | NO | | CURRENT_TIMESTAMP | |
# | active | tinyint(4) | NO | | 1 | |
# +-------------+--------------+------+-----+---------------------+-------+
# 8 rows in set (0.00 sec)
@@ -42,7 +42,7 @@ Stefan Kangas C<< <skangas at skangas.se> >>
=head1 COPYRIGHT
-Copyright 2010 Stefan Kangas, all rights reserved.
+Copyright 2010,2011 Stefan Kangas, all rights reserved.
=head1 LICENSE