Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added twitter column to mp table. Regenerate schema classes.

  • Loading branch information...
commit 72491d0064d5aa2ffd2fb14a14afdc354fe37471 1 parent 8931e52
Dave Cross authored
3  PoliticalWeb/lib/PoliticalWeb/Mp.pm
View
@@ -23,6 +23,7 @@ has twfy => (
has db => (
is => 'rw',
isa => 'PoliticalWeb::Schema::Result::Mp',
+ handles => [qw(twitter)],
);
sub new_from_constituency_name {
@@ -79,4 +80,4 @@ sub _get_from_db {
});
}
-1;
+1;
5 PoliticalWeb/lib/PoliticalWeb/Schema.pm
View
@@ -1,3 +1,4 @@
+use utf8;
package PoliticalWeb::Schema;
# Created by DBIx::Class::Schema::Loader
@@ -11,8 +12,8 @@ use base 'DBIx::Class::Schema';
__PACKAGE__->load_namespaces;
-# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-03-18 16:38:10
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:u/9/ih+QqFRVhUnfVTcOQg
+# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-07-23 16:14:54
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sq/NtIS8StNo/cTNgu2JWA
# You can replace this text with custom code or comments, and it will be preserved on regeneration
60 PoliticalWeb/lib/PoliticalWeb/Schema/Result/Constituency.pm
View
@@ -1,17 +1,21 @@
+use utf8;
package PoliticalWeb::Schema::Result::Constituency;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
+=head1 NAME
+
+PoliticalWeb::Schema::Result::Constituency
+
+=cut
+
use strict;
use warnings;
use base 'DBIx::Class::Core';
-
-=head1 NAME
-
-PoliticalWeb::Schema::Result::Constituency
+=head1 TABLE: C<constituency>
=cut
@@ -47,29 +51,20 @@ __PACKAGE__->add_columns(
"mp",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
);
-__PACKAGE__->set_primary_key("id");
-=head1 RELATIONS
+=head1 PRIMARY KEY
-=head2 mp
+=over 4
-Type: belongs_to
+=item * L</id>
-Related object: L<PoliticalWeb::Schema::Result::Mp>
+=back
=cut
-__PACKAGE__->belongs_to(
- "mp",
- "PoliticalWeb::Schema::Result::Mp",
- { id => "mp" },
- {
- is_deferrable => 1,
- join_type => "LEFT",
- on_delete => "CASCADE",
- on_update => "CASCADE",
- },
-);
+__PACKAGE__->set_primary_key("id");
+
+=head1 RELATIONS
=head2 constituency_links
@@ -86,19 +81,24 @@ __PACKAGE__->has_many(
{ cascade_copy => 0, cascade_delete => 0 },
);
-=head2 urls
+=head2 mp
-Type: has_many
+Type: belongs_to
-Related object: L<PoliticalWeb::Schema::Result::Url>
+Related object: L<PoliticalWeb::Schema::Result::Mp>
=cut
-__PACKAGE__->has_many(
- "urls",
- "PoliticalWeb::Schema::Result::Url",
- { "foreign.constituency" => "self.id" },
- { cascade_copy => 0, cascade_delete => 0 },
+__PACKAGE__->belongs_to(
+ "mp",
+ "PoliticalWeb::Schema::Result::Mp",
+ { id => "mp" },
+ {
+ is_deferrable => 1,
+ join_type => "LEFT",
+ on_delete => "RESTRICT",
+ on_update => "RESTRICT",
+ },
);
=head2 user_constituencies
@@ -117,8 +117,8 @@ __PACKAGE__->has_many(
);
-# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-03-18 16:38:10
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hzCQrsZiMUwIMBxUwQJoPA
+# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-07-23 16:14:54
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:M8D5lj7A3oC2eeX/pn9+DQ
# You can replace this text with custom code or comments, and it will be preserved on regeneration
31 PoliticalWeb/lib/PoliticalWeb/Schema/Result/ConstituencyLink.pm
View
@@ -1,17 +1,21 @@
+use utf8;
package PoliticalWeb::Schema::Result::ConstituencyLink;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
+=head1 NAME
+
+PoliticalWeb::Schema::Result::ConstituencyLink
+
+=cut
+
use strict;
use warnings;
use base 'DBIx::Class::Core';
-
-=head1 NAME
-
-PoliticalWeb::Schema::Result::ConstituencyLink
+=head1 TABLE: C<constituency_link>
=cut
@@ -62,6 +66,17 @@ __PACKAGE__->add_columns(
"constituency",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
);
+
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</id>
+
+=back
+
+=cut
+
__PACKAGE__->set_primary_key("id");
=head1 RELATIONS
@@ -81,14 +96,14 @@ __PACKAGE__->belongs_to(
{
is_deferrable => 1,
join_type => "LEFT",
- on_delete => "CASCADE",
- on_update => "CASCADE",
+ on_delete => "NO ACTION",
+ on_update => "NO ACTION",
},
);
-# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-03-18 16:38:10
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tifgLNyGt0lUzNY7Epf1ug
+# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-07-23 16:14:54
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+U6cFJKqnDMMu4seeD6iqQ
# You can replace this text with custom code or comments, and it will be preserved on regeneration
54 PoliticalWeb/lib/PoliticalWeb/Schema/Result/Mp.pm
View
@@ -1,17 +1,21 @@
+use utf8;
package PoliticalWeb::Schema::Result::Mp;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
+=head1 NAME
+
+PoliticalWeb::Schema::Result::Mp
+
+=cut
+
use strict;
use warnings;
use base 'DBIx::Class::Core';
-
-=head1 NAME
-
-PoliticalWeb::Schema::Result::Mp
+=head1 TABLE: C<mp>
=cut
@@ -28,7 +32,7 @@ __PACKAGE__->table("mp");
=head2 mp_name
data_type: 'varchar'
- is_nullable: 0
+ is_nullable: 1
size: 45
=head2 twfy_id
@@ -36,6 +40,11 @@ __PACKAGE__->table("mp");
data_type: 'integer'
is_nullable: 0
+=head2 twfy_mem_id
+
+ data_type: 'integer'
+ is_nullable: 0
+
=head2 image_url
data_type: 'varchar'
@@ -72,15 +81,29 @@ __PACKAGE__->table("mp");
is_nullable: 1
size: 100
+=head2 official_site_url
+
+ data_type: 'varchar'
+ is_nullable: 1
+ size: 100
+
+=head2 twitter
+
+ data_type: 'varchar'
+ is_nullable: 1
+ size: 25
+
=cut
__PACKAGE__->add_columns(
"id",
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"mp_name",
- { data_type => "varchar", is_nullable => 0, size => 45 },
+ { data_type => "varchar", is_nullable => 1, size => 45 },
"twfy_id",
{ data_type => "integer", is_nullable => 0 },
+ "twfy_mem_id",
+ { data_type => "integer", is_nullable => 0 },
"image_url",
{ data_type => "varchar", is_nullable => 1, size => 200 },
"party",
@@ -93,7 +116,22 @@ __PACKAGE__->add_columns(
{ data_type => "varchar", is_nullable => 1, size => 100 },
"wikipedia_url",
{ data_type => "varchar", is_nullable => 1, size => 100 },
+ "official_site_url",
+ { data_type => "varchar", is_nullable => 1, size => 100 },
+ "twitter",
+ { data_type => "varchar", is_nullable => 1, size => 25 },
);
+
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</id>
+
+=back
+
+=cut
+
__PACKAGE__->set_primary_key("id");
=head1 RELATIONS
@@ -129,8 +167,8 @@ __PACKAGE__->has_many(
);
-# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-03-18 16:38:10
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OKBxs5sEHhCR8ygvU02/hA
+# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-07-23 16:14:54
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pKe/7tMZUV08ykrBE0SsxA
# You can replace this text with custom code or comments, and it will be preserved on regeneration
31 PoliticalWeb/lib/PoliticalWeb/Schema/Result/MpLink.pm
View
@@ -1,17 +1,21 @@
+use utf8;
package PoliticalWeb::Schema::Result::MpLink;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
+=head1 NAME
+
+PoliticalWeb::Schema::Result::MpLink
+
+=cut
+
use strict;
use warnings;
use base 'DBIx::Class::Core';
-
-=head1 NAME
-
-PoliticalWeb::Schema::Result::MpLink
+=head1 TABLE: C<mp_link>
=cut
@@ -62,6 +66,17 @@ __PACKAGE__->add_columns(
"mp",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
);
+
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</id>
+
+=back
+
+=cut
+
__PACKAGE__->set_primary_key("id");
=head1 RELATIONS
@@ -81,14 +96,14 @@ __PACKAGE__->belongs_to(
{
is_deferrable => 1,
join_type => "LEFT",
- on_delete => "CASCADE",
- on_update => "CASCADE",
+ on_delete => "NO ACTION",
+ on_update => "NO ACTION",
},
);
-# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-03-18 16:38:10
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5Wf8X81TbVgUsIp/ahdu2w
+# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-07-23 16:14:54
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:B2e4gMt0JIcjEy0l/xgePw
# You can replace this text with custom code or comments, and it will be preserved on regeneration
27 PoliticalWeb/lib/PoliticalWeb/Schema/Result/User.pm
View
@@ -1,17 +1,21 @@
+use utf8;
package PoliticalWeb::Schema::Result::User;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
+=head1 NAME
+
+PoliticalWeb::Schema::Result::User
+
+=cut
+
use strict;
use warnings;
use base 'DBIx::Class::Core';
-
-=head1 NAME
-
-PoliticalWeb::Schema::Result::User
+=head1 TABLE: C<user>
=cut
@@ -54,6 +58,17 @@ __PACKAGE__->add_columns(
"email",
{ data_type => "varchar", is_nullable => 1, size => 45 },
);
+
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</id>
+
+=back
+
+=cut
+
__PACKAGE__->set_primary_key("id");
=head1 RELATIONS
@@ -74,8 +89,8 @@ __PACKAGE__->has_many(
);
-# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-03-18 16:38:10
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:XZACBwSqu3R/1bSHPIe2qg
+# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-07-23 16:14:54
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zgQw9D2CJHTlRtefJ6lDqQ
# You can replace this text with custom code or comments, and it will be preserved on regeneration
31 PoliticalWeb/lib/PoliticalWeb/Schema/Result/UserConstituency.pm
View
@@ -1,17 +1,21 @@
+use utf8;
package PoliticalWeb::Schema::Result::UserConstituency;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
+=head1 NAME
+
+PoliticalWeb::Schema::Result::UserConstituency
+
+=cut
+
use strict;
use warnings;
use base 'DBIx::Class::Core';
-
-=head1 NAME
-
-PoliticalWeb::Schema::Result::UserConstituency
+=head1 TABLE: C<user_constituency>
=cut
@@ -46,6 +50,17 @@ __PACKAGE__->add_columns(
"constituency",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
);
+
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</id>
+
+=back
+
+=cut
+
__PACKAGE__->set_primary_key("id");
=head1 RELATIONS
@@ -62,7 +77,7 @@ __PACKAGE__->belongs_to(
"constituency",
"PoliticalWeb::Schema::Result::Constituency",
{ id => "constituency" },
- { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+ { is_deferrable => 1, on_delete => "NO ACTION", on_update => "NO ACTION" },
);
=head2 user
@@ -77,12 +92,12 @@ __PACKAGE__->belongs_to(
"user",
"PoliticalWeb::Schema::Result::User",
{ id => "user" },
- { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+ { is_deferrable => 1, on_delete => "NO ACTION", on_update => "NO ACTION" },
);
-# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-03-18 16:38:10
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GOCCP6YSDd2rLD2Kmokrzg
+# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-07-23 16:14:54
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TPHWJ/+SqJO/9sKyBIjSOg
# You can replace this text with custom code or comments, and it will be preserved on regeneration
Please sign in to comment.
Something went wrong with that request. Please try again.