Skip to content

Commit

Permalink
add cre boolean to cassette table
Browse files Browse the repository at this point in the history
  • Loading branch information
mathspete committed Dec 7, 2012
1 parent 6e2cecf commit 7d45de3
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
1 change: 1 addition & 0 deletions ddl/templates/versions/17/audit-up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE audit.cassettes ADD COLUMN cre boolean;
2 changes: 2 additions & 0 deletions ddl/templates/versions/17/fixtures.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INSERT INTO schema_versions(version)
VALUES (17);
2 changes: 2 additions & 0 deletions ddl/templates/versions/17/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE cassettes ADD COLUMN cre BOOLEAN NOT NULL DEFAULT false;

8 changes: 7 additions & 1 deletion lib/LIMS2/CassetteFunction.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Readonly my $CASSETTE_FUNCTION_CHECKS => {
reporter_only => [ \&has_conditional_cassette, \&has_cre_recombinase ],
reporter_only_promoter => [ \&has_conditional_cassette, \&has_promoter_cassette, \&has_cre_recombinase ],
reporter_only_promoterless => [ \&has_conditional_cassette, \&has_promoterless_cassette, \&has_cre_recombinase ],
cre_knock_in => [ \&has_cre_recombinase ]
cre_knock_in => [ \&has_cre_cassette ]
};

sub satisfies_cassette_function {
Expand Down Expand Up @@ -48,6 +48,12 @@ sub has_promoterless_cassette {
return ! has_promoter_cassette($well);
}

sub has_cre_cassette {
my $well = shift;

return $well->cassette->cre;
}

sub has_cre_recombinase {
my $well = shift;

Expand Down
12 changes: 10 additions & 2 deletions lib/LIMS2/Model/Schema/Result/Cassette.pm
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ __PACKAGE__->table("cassettes");
default_value: false
is_nullable: 0
=head2 cre
data_type: 'boolean'
default_value: false
is_nullable: 0
=cut

__PACKAGE__->add_columns(
Expand All @@ -99,6 +105,8 @@ __PACKAGE__->add_columns(
{ data_type => "integer", is_nullable => 1 },
"conditional",
{ data_type => "boolean", default_value => \"false", is_nullable => 0 },
"cre",
{ data_type => "boolean", default_value => \"false", is_nullable => 0 },
);

=head1 PRIMARY KEY
Expand Down Expand Up @@ -160,8 +168,8 @@ __PACKAGE__->has_many(
);


# Created by DBIx::Class::Schema::Loader v0.07022 @ 2012-12-03 17:06:37
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fcVntXyx91OdbxSzjTKzQg
# Created by DBIx::Class::Schema::Loader v0.07022 @ 2012-12-07 12:55:50
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:z73XIdwVTI4m7e5PXZB4uw


# You can replace this text with custom code or comments, and it will be preserved on regeneration
Expand Down

0 comments on commit 7d45de3

Please sign in to comment.