Mercurial > pub > Impl
comparison _test/Test/ORM/Schema.pm @ 44:32d2350fccf9
ORM
*Minor fixes
*Working tarnsform to sql
*Fixes to the sql traits
author | Sergey |
---|---|
date | Mon, 11 Jan 2010 01:42:00 +0300 |
parents | d660fb38b7cc |
children | 16ada169ca75 |
comparison
equal
deleted
inserted
replaced
43:009aa9ca2e48 | 44:32d2350fccf9 |
---|---|
1 package Test::ORM::Schema; | 1 package Test::ORM::Schema; |
2 use strict; | 2 use strict; |
3 use warnings; | 3 use warnings; |
4 use base qw(IMPL::Test::Unit); | 4 use base qw(IMPL::Test::Unit); |
5 | |
6 require IMPL::SQL::Schema::Traits::mysql; | |
5 | 7 |
6 __PACKAGE__->PassThroughArgs; | 8 __PACKAGE__->PassThroughArgs; |
7 | 9 |
8 use IMPL::Test qw(test failed); | 10 use IMPL::Test qw(test failed); |
9 | 11 |
24 my $schema = Test::ORM::Schema::Data->instance; | 26 my $schema = Test::ORM::Schema::Data->instance; |
25 | 27 |
26 return 1; | 28 return 1; |
27 }; | 29 }; |
28 | 30 |
29 test TransformDataSchema => sub { | 31 test GenerateSQL => sub { |
30 my $sqlSchema = IMPL::ORM::Schema::TransformToSQL->Std->Transform(Test::ORM::Schema::Data->instance) | 32 my $sqlSchema = IMPL::ORM::Schema::TransformToSQL->Std->Transform(Test::ORM::Schema::Data->instance) |
31 or failed("Failed to transform a schema"); | 33 or failed("Failed to transform a schema"); |
34 | |
35 my $sqlEmpty = new IMPL::SQL::Schema(Name => 'empty'); | |
36 | |
37 my $traits = IMPL::SQL::Schema::Traits::mysql->new( | |
38 SrcSchema => $sqlEmpty, | |
39 DstSchema => $sqlSchema | |
40 ); | |
41 | |
42 $traits->UpdateSchema(); | |
43 | |
44 print "$_\n" foreach $traits->Handler->Sql; | |
45 | |
46 $sqlEmpty->Dispose; | |
32 $sqlSchema->Dispose; | 47 $sqlSchema->Dispose; |
33 }; | 48 }; |
34 | 49 |
35 | 50 |
36 package Test::ORM::Schema::Data::User; | 51 package Test::ORM::Schema::Data::User; |