$self->columns
);
$table->set_primary_key($self->primary_columns);
+
+ # Attempting to re-add sequence here -- AKB
+ for my $pk ( $self->primary_columns ) {
+ $table->columns_info->{$pk}->{sequence} =
+ $self->set_sequence( $table->name, $self->primary_columns )
+ unless grep {
+ $table->columns_info->{$_}->{originally_defined_in} ne $self->name
+ } keys %{ $table->columns_info };
+ }
# we need to copy our rels to the raw object as well
# note that ->add_relationship on a source object doesn't create an
return $self->next::method(@args);
}
+method set_sequence ($table_name, @pks) {
+ return $table_name . '_' . join('_',@pks) . '_' . 'seq';
+}
+
method raw_source_name () {
my $base = $self->source_name;
confess "Can't generate raw source name for ${\$self->name} when we don't have a source_name"
$drink1 = $schema->resultset('Coffee')->create( { flavor => 'aaight', } );
}
"I can do it for the other view, too";
+
+
__PACKAGE__->table_class(MTI);
__PACKAGE__->table('coffee');
__PACKAGE__->add_columns(
- "id", { data_type => "integer", is_auto_increment => 1, sequence => '_coffee_id_seq'},
+ "id", { data_type => "integer", is_auto_increment => 1},
"flavor", { data_type => "text", default_value => "good" },
);