);
$self->deploy_depends_on->{$add->result_class} = 1;
}
-
- # add every column that's actually a concrete part of us
-
$table->add_columns(
map { ($_ => { %{$self->column_info($_)} }) }
grep { $self->column_info($_)->{originally_defined_in} eq $self->name }
use Test::More qw(no_plan);
use Test::Exception;
use LoadTest;
+use Devel::Dwarn;
BEGIN {
$ENV{DBIC_TRACE} = 0;
$schema->deploy( { add_drop_table => 1, add_drop_view => 1, } );
}
"It's also OK to deploy the schema";
+
+my $sqlt_object = $schema->{sqlt};
+
+is_deeply(
+ [ map { $_->name } $sqlt_object->get_views ],
+ [ qw/
+ foo
+ bar
+ /
+ ],
+ "SQLT view order triumphantly matches our order."
+);
+
}
"I can do it for the other view, too";
+my $sqlt_object = $schema->{sqlt};
+
+is_deeply(
+ [ map { $_->name } $sqlt_object->get_views ],
+ [ qw/
+ coffee
+ sumatra
+ /
+ ],
+ "SQLT view order triumphantly matches our order."
+);
+
-package CafeInsertion;
+package # hide from PAUSE
+ CafeInsertion;
use strict;
use warnings;
for grep $_->isa(MTIView), map $p->source($_), $p->sources;
}
+sub sqlt_deploy_hook {
+ my $self = shift;
+ $self->{sqlt} = shift;
+}
+
1;
-package CafeInsertion::Result::Coffee;
+package # hide from PAUSE
+ CafeInsertion::Result::Coffee;
use strict;
use warnings;
-package CafeInsertion::Result::Sugar;
+package # hide from PAUSE
+ CafeInsertion::Result::Sugar;
use strict;
use warnings;
-package CafeInsertion::Result::Sumatra;
+package # hide from PAUSE
+ CafeInsertion::Result::Sumatra;
use strict;
use warnings;
-package LoadTest;
+package # hide from PAUSE
+ LoadTest;
use strict;
use warnings;
for grep $_->isa(MTIView), map $p->source($_), $p->sources;
}
+sub sqlt_deploy_hook {
+ my $self = shift;
+ $self->{sqlt} = shift;
+}
+
1;
-package LoadTest::Result::Bar;
+package # hide from PAUSE
+ LoadTest::Result::Bar;
use strict;
use warnings;
-use parent qw(LoadTest::Result::Foo);
+use parent 'LoadTest::Result::Foo';
require LoadTest::Result::Mixin;
b => { data_type => 'integer' }
);
-__PACKAGE__->belongs_to(
- 'b_thang',
- 'LoadTest::Result::JustATable',
- { 'foreign.id' => 'self.b' },
-);
-
-__PACKAGE__->has_many(
- 'foos',
- 'LoadTest::Result::Foo',
- { 'foreign.a' => 'self.id' }
-);
+#__PACKAGE__->belongs_to(
+ #'b_thang',
+ #'LoadTest::Result::JustATable',
+ #{ 'foreign.id' => 'self.b' },
+#);
+
+#__PACKAGE__->has_many(
+ #'foos',
+ #'LoadTest::Result::Foo',
+ #{ 'foreign.a' => 'self.id' }
+#);
1;
-package LoadTest::Result::Foo;
+package # hide from PAUSE
+ LoadTest::Result::Foo;
use strict;
use warnings;
__PACKAGE__->set_primary_key('id');
-__PACKAGE__->belongs_to(
- 'bar',
- 'LoadTest::Result::Bar',
- { 'foreign.id' => 'self.a' }
-);
+#__PACKAGE__->belongs_to(
+ #'bar',
+ #'LoadTest::Result::Bar',
+ #{ 'foreign.id' => 'self.a' }
+#);
1;
-package LoadTest::Result::JustATable;
+package # hide from PAUSE
+ LoadTest::Result::JustATable;
use base qw(DBIx::Class::Core);
-package LoadTest::Result::Mixin;
+package # hide from PAUSE
+ LoadTest::Result::Mixin;
use strict;
use warnings;
-package NoSequenceSalad;
+package # hide from PAUSE
+ NoSequenceSalad;
use strict;
use warnings;
for grep $_->isa(MTIView), map $p->source($_), $p->sources;
}
+sub sqlt_deploy_hook {
+ my $self = shift;
+ $self->{sqlt} = shift;
+}
+
1;
-package NoSequenceSalad::Result::Dressing;
+package # hide from PAUSE
+ NoSequenceSalad::Result::Dressing;
use strict;
use warnings;
-package NoSequenceSalad::Result::Mesclun;
+package # hide from PAUSE
+ NoSequenceSalad::Result::Mesclun;
use strict;
use warnings;
-package NoSequenceSalad::Result::Salad;
+package # hide from PAUSE
+ NoSequenceSalad::Result::Salad;
use strict;
use warnings;