Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added twitter column to mp table. Regenerate schema classes.

  • Loading branch information...
commit 72491d0064d5aa2ffd2fb14a14afdc354fe37471 1 parent 8931e52
Dave Cross authored July 23, 2013
3  PoliticalWeb/lib/PoliticalWeb/Mp.pm
@@ -23,6 +23,7 @@ has twfy => (
23 23
 has db => (
24 24
   is   => 'rw',
25 25
   isa  => 'PoliticalWeb::Schema::Result::Mp',
  26
+  handles => [qw(twitter)],
26 27
 );
27 28
 
28 29
 sub new_from_constituency_name {
@@ -79,4 +80,4 @@ sub _get_from_db {
79 80
   });  
80 81
 }
81 82
 
82  
-1;
  83
+1;
5  PoliticalWeb/lib/PoliticalWeb/Schema.pm
... ...
@@ -1,3 +1,4 @@
  1
+use utf8;
1 2
 package PoliticalWeb::Schema;
2 3
 
3 4
 # Created by DBIx::Class::Schema::Loader
@@ -11,8 +12,8 @@ use base 'DBIx::Class::Schema';
11 12
 __PACKAGE__->load_namespaces;
12 13
 
13 14
 
14  
-# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-03-18 16:38:10
15  
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:u/9/ih+QqFRVhUnfVTcOQg
  15
+# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-07-23 16:14:54
  16
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sq/NtIS8StNo/cTNgu2JWA
16 17
 
17 18
 
18 19
 # 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
... ...
@@ -1,17 +1,21 @@
  1
+use utf8;
1 2
 package PoliticalWeb::Schema::Result::Constituency;
2 3
 
3 4
 # Created by DBIx::Class::Schema::Loader
4 5
 # DO NOT MODIFY THE FIRST PART OF THIS FILE
5 6
 
  7
+=head1 NAME
  8
+
  9
+PoliticalWeb::Schema::Result::Constituency
  10
+
  11
+=cut
  12
+
6 13
 use strict;
7 14
 use warnings;
8 15
 
9 16
 use base 'DBIx::Class::Core';
10 17
 
11  
-
12  
-=head1 NAME
13  
-
14  
-PoliticalWeb::Schema::Result::Constituency
  18
+=head1 TABLE: C<constituency>
15 19
 
16 20
 =cut
17 21
 
@@ -47,29 +51,20 @@ __PACKAGE__->add_columns(
47 51
   "mp",
48 52
   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
49 53
 );
50  
-__PACKAGE__->set_primary_key("id");
51 54
 
52  
-=head1 RELATIONS
  55
+=head1 PRIMARY KEY
53 56
 
54  
-=head2 mp
  57
+=over 4
55 58
 
56  
-Type: belongs_to
  59
+=item * L</id>
57 60
 
58  
-Related object: L<PoliticalWeb::Schema::Result::Mp>
  61
+=back
59 62
 
60 63
 =cut
61 64
 
62  
-__PACKAGE__->belongs_to(
63  
-  "mp",
64  
-  "PoliticalWeb::Schema::Result::Mp",
65  
-  { id => "mp" },
66  
-  {
67  
-    is_deferrable => 1,
68  
-    join_type     => "LEFT",
69  
-    on_delete     => "CASCADE",
70  
-    on_update     => "CASCADE",
71  
-  },
72  
-);
  65
+__PACKAGE__->set_primary_key("id");
  66
+
  67
+=head1 RELATIONS
73 68
 
74 69
 =head2 constituency_links
75 70
 
@@ -86,19 +81,24 @@ __PACKAGE__->has_many(
86 81
   { cascade_copy => 0, cascade_delete => 0 },
87 82
 );
88 83
 
89  
-=head2 urls
  84
+=head2 mp
90 85
 
91  
-Type: has_many
  86
+Type: belongs_to
92 87
 
93  
-Related object: L<PoliticalWeb::Schema::Result::Url>
  88
+Related object: L<PoliticalWeb::Schema::Result::Mp>
94 89
 
95 90
 =cut
96 91
 
97  
-__PACKAGE__->has_many(
98  
-  "urls",
99  
-  "PoliticalWeb::Schema::Result::Url",
100  
-  { "foreign.constituency" => "self.id" },
101  
-  { cascade_copy => 0, cascade_delete => 0 },
  92
+__PACKAGE__->belongs_to(
  93
+  "mp",
  94
+  "PoliticalWeb::Schema::Result::Mp",
  95
+  { id => "mp" },
  96
+  {
  97
+    is_deferrable => 1,
  98
+    join_type     => "LEFT",
  99
+    on_delete     => "RESTRICT",
  100
+    on_update     => "RESTRICT",
  101
+  },
102 102
 );
103 103
 
104 104
 =head2 user_constituencies
@@ -117,8 +117,8 @@ __PACKAGE__->has_many(
117 117
 );
118 118
 
119 119
 
120  
-# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-03-18 16:38:10
121  
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hzCQrsZiMUwIMBxUwQJoPA
  120
+# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-07-23 16:14:54
  121
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:M8D5lj7A3oC2eeX/pn9+DQ
122 122
 
123 123
 
124 124
 # 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
... ...
@@ -1,17 +1,21 @@
@@ -62,6 +66,17 @@ __PACKAGE__->add_columns(
@@ -81,14 +96,14 @@ __PACKAGE__->belongs_to(
54  PoliticalWeb/lib/PoliticalWeb/Schema/Result/Mp.pm
... ...
@@ -1,17 +1,21 @@
  1
+use utf8;
1 2
 package PoliticalWeb::Schema::Result::Mp;
2 3
 
3 4
 # Created by DBIx::Class::Schema::Loader
4 5
 # DO NOT MODIFY THE FIRST PART OF THIS FILE
5 6
 
  7
+=head1 NAME
  8
+
  9
+PoliticalWeb::Schema::Result::Mp
  10
+
  11
+=cut
  12
+
6 13
 use strict;
7 14
 use warnings;
8 15
 
9 16
 use base 'DBIx::Class::Core';
10 17
 
11  
-
12  
-=head1 NAME
13  
-
14  
-PoliticalWeb::Schema::Result::Mp
  18
+=head1 TABLE: C<mp>
15 19
 
16 20
 =cut
17 21
 
@@ -28,7 +32,7 @@ __PACKAGE__->table("mp");
28 32
 =head2 mp_name
29 33
 
30 34
   data_type: 'varchar'
31  
-  is_nullable: 0
  35
+  is_nullable: 1
32 36
   size: 45
33 37
 
34 38
 =head2 twfy_id
@@ -36,6 +40,11 @@ __PACKAGE__->table("mp");
36 40
   data_type: 'integer'
37 41
   is_nullable: 0
38 42
 
  43
+=head2 twfy_mem_id
  44
+
  45
+  data_type: 'integer'
  46
+  is_nullable: 0
  47
+
39 48
 =head2 image_url
40 49
 
41 50
   data_type: 'varchar'
@@ -72,15 +81,29 @@ __PACKAGE__->table("mp");
72 81
   is_nullable: 1
73 82
   size: 100
74 83
 
  84
+=head2 official_site_url
  85
+
  86
+  data_type: 'varchar'
  87
+  is_nullable: 1
  88
+  size: 100
  89
+
  90
+=head2 twitter
  91
+
  92
+  data_type: 'varchar'
  93
+  is_nullable: 1
  94
+  size: 25
  95
+
75 96
 =cut
76 97
 
77 98
 __PACKAGE__->add_columns(
78 99
   "id",
79 100
   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
80 101
   "mp_name",
81  
-  { data_type => "varchar", is_nullable => 0, size => 45 },
  102
+  { data_type => "varchar", is_nullable => 1, size => 45 },
82 103
   "twfy_id",
83 104
   { data_type => "integer", is_nullable => 0 },
  105
+  "twfy_mem_id",
  106
+  { data_type => "integer", is_nullable => 0 },
84 107
   "image_url",
85 108
   { data_type => "varchar", is_nullable => 1, size => 200 },
86 109
   "party",
@@ -93,7 +116,22 @@ __PACKAGE__->add_columns(
93 116
   { data_type => "varchar", is_nullable => 1, size => 100 },
94 117
   "wikipedia_url",
95 118
   { data_type => "varchar", is_nullable => 1, size => 100 },
  119
+  "official_site_url",
  120
+  { data_type => "varchar", is_nullable => 1, size => 100 },
  121
+  "twitter",
  122
+  { data_type => "varchar", is_nullable => 1, size => 25 },
96 123
 );
  124
+
  125
+=head1 PRIMARY KEY
  126
+
  127
+=over 4
  128
+
  129
+=item * L</id>
  130
+
  131
+=back
  132
+
  133
+=cut
  134
+
97 135
 __PACKAGE__->set_primary_key("id");
98 136
 
99 137
 =head1 RELATIONS
@@ -129,8 +167,8 @@ __PACKAGE__->has_many(
129 167
 );
130 168
 
131 169
 
132  
-# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-03-18 16:38:10
133  
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OKBxs5sEHhCR8ygvU02/hA
  170
+# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-07-23 16:14:54
  171
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pKe/7tMZUV08ykrBE0SsxA
134 172
 
135 173
 
136 174
 # 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
... ...
@@ -1,17 +1,21 @@
@@ -62,6 +66,17 @@ __PACKAGE__->add_columns(
@@ -81,14 +96,14 @@ __PACKAGE__->belongs_to(
27  PoliticalWeb/lib/PoliticalWeb/Schema/Result/User.pm
... ...
@@ -1,17 +1,21 @@
  1
+use utf8;
1 2
 package PoliticalWeb::Schema::Result::User;
2 3
 
3 4
 # Created by DBIx::Class::Schema::Loader
4 5
 # DO NOT MODIFY THE FIRST PART OF THIS FILE
5 6
 
  7
+=head1 NAME
  8
+
  9
+PoliticalWeb::Schema::Result::User
  10
+
  11
+=cut
  12
+
6 13
 use strict;
7 14
 use warnings;
8 15
 
9 16
 use base 'DBIx::Class::Core';
10 17
 
11  
-
12  
-=head1 NAME
13  
-
14  
-PoliticalWeb::Schema::Result::User
  18
+=head1 TABLE: C<user>
15 19
 
16 20
 =cut
17 21
 
@@ -54,6 +58,17 @@ __PACKAGE__->add_columns(
54 58
   "email",
55 59
   { data_type => "varchar", is_nullable => 1, size => 45 },
56 60
 );
  61
+
  62
+=head1 PRIMARY KEY
  63
+
  64
+=over 4
  65
+
  66
+=item * L</id>
  67
+
  68
+=back
  69
+
  70
+=cut
  71
+
57 72
 __PACKAGE__->set_primary_key("id");
58 73
 
59 74
 =head1 RELATIONS
@@ -74,8 +89,8 @@ __PACKAGE__->has_many(
74 89
 );
75 90
 
76 91
 
77  
-# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-03-18 16:38:10
78  
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:XZACBwSqu3R/1bSHPIe2qg
  92
+# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-07-23 16:14:54
  93
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zgQw9D2CJHTlRtefJ6lDqQ
79 94
 
80 95
 
81 96
 # 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
... ...
@@ -1,17 +1,21 @@
  1
+use utf8;
1 2
 package PoliticalWeb::Schema::Result::UserConstituency;
2 3
 
3 4
 # Created by DBIx::Class::Schema::Loader
4 5
 # DO NOT MODIFY THE FIRST PART OF THIS FILE
5 6
 
  7
+=head1 NAME
  8
+
  9
+PoliticalWeb::Schema::Result::UserConstituency
  10
+
  11
+=cut
  12
+
6 13
 use strict;
7 14
 use warnings;
8 15
 
9 16
 use base 'DBIx::Class::Core';
10 17
 
11  
-
12  
-=head1 NAME
13  
-
14  
-PoliticalWeb::Schema::Result::UserConstituency
  18
+=head1 TABLE: C<user_constituency>
15 19
 
16 20
 =cut
17 21
 
@@ -46,6 +50,17 @@ __PACKAGE__->add_columns(
46 50
   "constituency",
47 51
   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
48 52
 );
  53
+
  54
+=head1 PRIMARY KEY
  55
+
  56
+=over 4
  57
+
  58
+=item * L</id>
  59
+
  60
+=back
  61
+
  62
+=cut
  63
+
49 64
 __PACKAGE__->set_primary_key("id");
50 65
 
51 66
 =head1 RELATIONS
@@ -62,7 +77,7 @@ __PACKAGE__->belongs_to(
62 77
   "constituency",
63 78
   "PoliticalWeb::Schema::Result::Constituency",
64 79
   { id => "constituency" },
65  
-  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
  80
+  { is_deferrable => 1, on_delete => "NO ACTION", on_update => "NO ACTION" },
66 81
 );
67 82
 
68 83
 =head2 user
@@ -77,12 +92,12 @@ __PACKAGE__->belongs_to(
77 92
   "user",
78 93
   "PoliticalWeb::Schema::Result::User",
79 94
   { id => "user" },
80  
-  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
  95
+  { is_deferrable => 1, on_delete => "NO ACTION", on_update => "NO ACTION" },
81 96
 );
82 97
 
83 98
 
84  
-# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-03-18 16:38:10
85  
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GOCCP6YSDd2rLD2Kmokrzg
  99
+# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-07-23 16:14:54
  100
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TPHWJ/+SqJO/9sKyBIjSOg
86 101
 
87 102
 
88 103
 # You can replace this text with custom code or comments, and it will be preserved on regeneration

0 notes on commit 72491d0

Please sign in to comment.
Something went wrong with that request. Please try again.