Browse files

Made primary keys auto_increment.

  • Loading branch information...
1 parent 547bc35 commit e0b882e6083853e0e3cfbdd23b6111387c533c63 @davorg committed Aug 16, 2014
View
6 db/twittelect.sql
@@ -1,18 +1,18 @@
begin;
create table party (
- id integer primary key,
+ id integer primary key auto_increment,
name varchar(200) not null
);
create table constituency (
- id integer primary key,
+ id integer primary key auto_increment,
name varchar(200) not null,
list_name varchar(200) not null
);
create table candidate (
- id integer primary key,
+ id integer primary key auto_increment,
name varchar(200) not null,
twitter varchar(200),
party_id integer not null,
View
7 lib/TwittElection/Schema/Result/Candidate.pm
@@ -43,6 +43,7 @@ __PACKAGE__->table("candidate");
=head2 id
data_type: 'integer'
+ is_auto_increment: 1
is_nullable: 0
=head2 name
@@ -79,7 +80,7 @@ __PACKAGE__->table("candidate");
__PACKAGE__->add_columns(
"id",
- { data_type => "integer", is_nullable => 0 },
+ { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"name",
{ data_type => "varchar", is_nullable => 0, size => 200 },
"twitter",
@@ -142,8 +143,8 @@ __PACKAGE__->belongs_to(
);
-# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-08-15 20:12:34
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CpWHo/zzZ6BBuVPuTXoQAQ
+# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-08-16 15:57:37
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yJTz5z4i1okZ1z9DkRBABw
# You can replace this text with custom code or comments, and it will be preserved on regeneration
View
11 lib/TwittElection/Schema/Result/Constituency.pm
@@ -43,6 +43,7 @@ __PACKAGE__->table("constituency");
=head2 id
data_type: 'integer'
+ is_auto_increment: 1
is_nullable: 0
=head2 name
@@ -54,18 +55,18 @@ __PACKAGE__->table("constituency");
=head2 list_name
data_type: 'varchar'
- is_nullable: 1
+ is_nullable: 0
size: 200
=cut
__PACKAGE__->add_columns(
"id",
- { data_type => "integer", is_nullable => 0 },
+ { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"name",
{ data_type => "varchar", is_nullable => 0, size => 200 },
"list_name",
- { data_type => "varchar", is_nullable => 1, size => 200 },
+ { data_type => "varchar", is_nullable => 0, size => 200 },
);
=head1 PRIMARY KEY
@@ -98,8 +99,8 @@ __PACKAGE__->has_many(
);
-# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-08-15 21:16:34
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:XVo8CoAkfeRnlUosED2ESw
+# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-08-16 15:57:37
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Hnn6Yg3WzYjCUHlas6197g
# You can replace this text with custom code or comments, and it will be preserved on regeneration
View
7 lib/TwittElection/Schema/Result/Party.pm
@@ -43,6 +43,7 @@ __PACKAGE__->table("party");
=head2 id
data_type: 'integer'
+ is_auto_increment: 1
is_nullable: 0
=head2 name
@@ -55,7 +56,7 @@ __PACKAGE__->table("party");
__PACKAGE__->add_columns(
"id",
- { data_type => "integer", is_nullable => 0 },
+ { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"name",
{ data_type => "varchar", is_nullable => 0, size => 200 },
);
@@ -90,8 +91,8 @@ __PACKAGE__->has_many(
);
-# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-08-15 20:12:34
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JCZbMFhxCEvMkmUtkSBc6A
+# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-08-16 15:57:37
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0AnUi1W5jVeiJjxX2M4aKg
# You can replace this text with custom code or comments, and it will be preserved on regeneration

0 comments on commit e0b882e

Please sign in to comment.