$table->add_relationship(
'parent_'.$add->name, $add->source_name, \%pk_join
);
- $self->deploy_depends_on->{$add->result_class} = 1;
+ $self->deploy_depends_on->{$add->result_class} = 1 if $add->isa('DBIx::Class::ResultSource::View');
}
$table->add_columns(
map { ($_ => { %{$self->column_info($_)} }) }
use Test::More qw(no_plan);
use Test::Exception;
use LoadTest;
-use Devel::Dwarn;
BEGIN {
$ENV{DBIC_TRACE} = 0;
my $schema = LoadTest->connect( $dsn, $user, $pass );
$schema->storage->ensure_connected;
+$schema->storage->dbh->{Warn} = 0;
my $dir = "t/sql"; # tempdir(CLEANUP => 0);
use Test::More qw(no_plan);
use Test::Exception;
use CafeInsertion;
+use Devel::Dwarn;
BEGIN {
$ENV{DBIC_TRACE} = 0;
my $schema = CafeInsertion->connect( $dsn, $user, $pass );
$schema->storage->ensure_connected;
$schema->storage->_use_insert_returning(0);
+$schema->storage->dbh->{Warn} = 0;
my $dir = "t/sql"; # tempdir(CLEANUP => 0);
$schema->create_ddl_dir( ['PostgreSQL'], 0.1, $dir );
my ( $drink, $drink1 );
lives_ok {
- $drink = $schema->resultset('Sumatra')
- ->create( { sweetness => 4, aroma => 'earthy', flavor => 'great' } );
+ $drink = $schema->resultset('Sumatra')->create(
+ { sweetness => 4,
+ fat_free => 1,
+ aroma => 'earthy',
+ flavor => 'great'
+ }
+ );
}
"I can call a create on a view sumatra";
"I can do it for the other view, too";
my $sqlt_object = $schema->{sqlt};
-
is_deeply(
[ map { $_->name } $sqlt_object->get_views ],
[ qw/
- coffee
+ coffee
sumatra
/
],
}
"I can do it for the other view, too";
+my $sqlt_object = $schema->{sqlt};
+is_deeply(
+ [ map { $_->name } $sqlt_object->get_views ],
+ [ qw/
+ salad
+ mesclun
+ /
+ ],
+ "SQLT view order triumphantly matches our order."
+);
__PACKAGE__->table_class(MTI);
__PACKAGE__->table('coffee');
+
__PACKAGE__->add_columns(
"id",
{ data_type => "integer",
--- /dev/null
+package # hide from PAUSE
+ CafeInsertion::Result::Cream;
+
+use strict;
+use warnings;
+use parent 'DBIx::Class::Core';
+
+__PACKAGE__->table('cream');
+
+__PACKAGE__->add_columns(
+ id => {
+ data_type => 'integer',
+ is_auto_increment => 1,
+ },
+ fat_free => { data_type => 'boolean', default => 0 }
+);
+
+__PACKAGE__->set_primary_key('id');
+
+1;
require CafeInsertion::Result::Sugar;
__PACKAGE__->table('sumatra');
+__PACKAGE__->result_source_instance->deploy_depends_on(["CafeInsertion::Result::Coffee"]);
__PACKAGE__->result_source_instance->add_additional_parents(
- "CafeInsertion::Result::Sugar");
+ "CafeInsertion::Result::Sugar","CafeInsertion::Result::Cream");
__PACKAGE__->add_columns( "aroma", { data_type => "text" } );
__PACKAGE__->has_many(
require LoadTest::Result::Mixin;
__PACKAGE__->table('bar');
-
+__PACKAGE__->result_source_instance->deploy_depends_on(["LoadTest::Result::Foo"]);
__PACKAGE__->result_source_instance->add_additional_parents(
"LoadTest::Result::Mixin" );
__PACKAGE__->set_primary_key('id');
-__PACKAGE__->has_many(
- 'bars',
- 'LoadTest::Result::Bar',
- { 'foreign.b' => 'self.id' }
-);
+#__PACKAGE__->has_many(
+ #'bars',
+ #'LoadTest::Result::Bar',
+ #{ 'foreign.b' => 'self.id' }
+#);
1;
require NoSequenceSalad::Result::Dressing;
__PACKAGE__->table('mesclun');
+__PACKAGE__->result_source_instance->deploy_depends_on(["NoSequenceSalad::Result::Salad"]);
__PACKAGE__->result_source_instance->add_additional_parent(
NoSequenceSalad::Result::Dressing->result_source_instance );
__PACKAGE__->add_columns( "spiciness", { data_type => "integer" } );