File tree Expand file tree Collapse file tree 4 files changed +63
-4
lines changed
Expand file tree Collapse file tree 4 files changed +63
-4
lines changed Original file line number Diff line number Diff line change 1+ # !/perl
12use warnings;
23use strict;
4+ use English ' -no_match_vars' ;
35use Test::More;
46use Test::Exception;
57use Test::SQL::Translator qw( maybe_plan) ;
@@ -12,10 +14,11 @@ BEGIN {
1214
1315my $sqlt_version = $SQL::Translator::VERSION ;
1416use YAML qw( Load) ;
15- my $yaml = Load(<<YAML );
17+ my $yaml = Load(<<" YAML" );
1618---
1719schema:
1820 procedures: {}
21+ sequences: {}
1922 tables:
2023 person:
2124 constraints:
@@ -241,9 +244,10 @@ translator:
241244YAML
242245
243246my $file = " $Bin /data/sqlite/create.sql" ;
244- open FH, " <$file " or die " Can't read '$file ': $! \n " ;
245- local $/ ;
246- my $data = <FH>;
247+ open my $fh , ' <' , $file or die " Can't read '$file ': $OS_ERROR \n " ;
248+ local $INPUT_RECORD_SEPARATOR = undef ;
249+ my $data = <$fh >;
250+ close $fh or die " Can't close '$file ': $OS_ERROR \n " ;
247251my $tr = SQL::Translator-> new(
248252 parser => ' SQLite' ,
249253 producer => ' YAML' ,
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ my $sqlt_version = $SQL::Translator::VERSION;
6969my $ans_yaml = qq{ ---
7070schema:
7171 procedures: {}
72+ sequences: {}
7273 tables:
7374 GdayWorld:
7475 constraints: []
Original file line number Diff line number Diff line change @@ -19,18 +19,61 @@ use SQL::Translator;
1919
2020my $in_yaml = qq{ ---
2121schema:
22+ sequences:
23+ IdentificationNumber:
24+ name: IdentificationNumber
25+ increment: 2
26+ order: 2
27+ BillingNumber:
28+ name: BillingNumber
29+ minvalue: 3
30+ maxvalue: 256
31+ order: 1
32+ owner: person.identification_number
2233 tables:
2334 Person:
2435 name: Person
2536 fields:
37+ identification_number:
38+ data_type: integer
39+ name: identification_number
40+ order: 1
2641 first_name:
2742 data_type: foovar
2843 name: first_name
44+ order: 2
2945} ;
3046
3147my $ans_yaml = qq{ ---
3248schema:
3349 procedures: {}
50+ sequences:
51+ BillingNumber:
52+ cache: 0
53+ cycle: 0
54+ guarantee_order: 0
55+ increment: 0
56+ keep: 0
57+ maxvalue: 256
58+ minvalue: 3
59+ name: BillingNumber
60+ order: 1
61+ owner: person.identification_number
62+ start: 0
63+ temporary: 0
64+ IdentificationNumber:
65+ cache: 0
66+ cycle: 0
67+ guarantee_order: 0
68+ increment: 2
69+ keep: 0
70+ maxvalue: 0
71+ minvalue: 0
72+ name: IdentificationNumber
73+ order: 2
74+ owner: NONE
75+ start: 0
76+ temporary: 0
3477 tables:
3578 person:
3679 constraints: []
@@ -42,6 +85,16 @@ schema:
4285 is_primary_key: 0
4386 is_unique: 0
4487 name: First_name
88+ order: 2
89+ size:
90+ - 0
91+ Identification_number:
92+ data_type: integer
93+ default_value: ~
94+ is_nullable: 1
95+ is_primary_key: 0
96+ is_unique: 0
97+ name: Identification_number
4598 order: 1
4699 size:
47100 - 0
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ is_deeply(
8686 {
8787 schema => {
8888 procedures => {},
89+ sequences => {},
8990 tables => {
9091 Person => {
9192 constraints => [ {
You can’t perform that action at this time.
0 commit comments