@@ -150,7 +150,7 @@ def test_schema_dump_includes_limit_constraint_for_integer_columns
150
150
end
151
151
152
152
def test_schema_dump_with_string_ignored_table
153
- output = dump_all_table_schema ( [ "accounts" ] )
153
+ output = dump_table_schema ( "authors" )
154
154
assert_no_match %r{create_table "accounts"} , output
155
155
assert_match %r{create_table "authors"} , output
156
156
assert_no_match %r{create_table "schema_migrations"} , output
@@ -350,13 +350,13 @@ def test_schema_dump_includes_extensions
350
350
connection = ActiveRecord ::Base . connection
351
351
352
352
connection . stub ( :extensions , [ "hstore" ] ) do
353
- output = dump_all_table_schema
353
+ output = dump_all_table_schema ( /./ )
354
354
assert_match "# These are extensions that must be enabled" , output
355
355
assert_match %r{enable_extension "hstore"} , output
356
356
end
357
357
358
358
connection . stub ( :extensions , [ ] ) do
359
- output = dump_all_table_schema
359
+ output = dump_all_table_schema ( /./ )
360
360
assert_no_match "# These are extensions that must be enabled" , output
361
361
assert_no_match %r{enable_extension} , output
362
362
end
@@ -366,13 +366,13 @@ def test_schema_dump_includes_extensions_in_alphabetic_order
366
366
connection = ActiveRecord ::Base . connection
367
367
368
368
connection . stub ( :extensions , [ "hstore" , "uuid-ossp" , "xml2" ] ) do
369
- output = dump_all_table_schema
369
+ output = dump_all_table_schema ( /./ )
370
370
enabled_extensions = output . scan ( %r{enable_extension "(.+)"} ) . flatten
371
371
assert_equal [ "hstore" , "uuid-ossp" , "xml2" ] , enabled_extensions
372
372
end
373
373
374
374
connection . stub ( :extensions , [ "uuid-ossp" , "xml2" , "hstore" ] ) do
375
- output = dump_all_table_schema
375
+ output = dump_all_table_schema ( /./ )
376
376
enabled_extensions = output . scan ( %r{enable_extension "(.+)"} ) . flatten
377
377
assert_equal [ "hstore" , "uuid-ossp" , "xml2" ] , enabled_extensions
378
378
end
@@ -457,7 +457,7 @@ def test_schema_dump_with_table_name_prefix_and_suffix
457
457
migration = CreateDogMigration . new
458
458
migration . migrate ( :up )
459
459
460
- output = dump_all_table_schema
460
+ output = dump_table_schema ( "dog_owners" , "dogs" )
461
461
assert_no_match %r{create_table "foo_.+_bar"} , output
462
462
assert_no_match %r{add_index "foo_.+_bar"} , output
463
463
assert_no_match %r{create_table "schema_migrations"} , output
@@ -482,7 +482,7 @@ def test_schema_dump_with_table_name_prefix_and_suffix_regexp_escape
482
482
migration = CreateDogMigration . new
483
483
migration . migrate ( :up )
484
484
485
- output = dump_all_table_schema
485
+ output = dump_table_schema ( "dog_owners" , "dog" )
486
486
assert_no_match %r{create_table "foo\$ .+\$ bar"} , output
487
487
assert_no_match %r{add_index "foo\$ .+\$ bar"} , output
488
488
assert_no_match %r{create_table "schema_migrations"} , output
@@ -550,7 +550,7 @@ def down
550
550
end
551
551
migration . migrate ( :up )
552
552
553
- output = dump_all_table_schema
553
+ output = dump_table_schema ( "timestamps" )
554
554
assert output . include? ( 't.datetime "this_should_remain_datetime"' )
555
555
assert output . include? ( 't.datetime "this_is_an_alias_of_datetime"' )
556
556
assert output . include? ( 't.datetime "without_time_zone"' )
@@ -579,7 +579,7 @@ def down
579
579
end
580
580
migration . migrate ( :up )
581
581
582
- output = dump_all_table_schema
582
+ output = dump_table_schema ( "timestamps" )
583
583
assert output . include? ( 't.datetime "this_should_remain_datetime"' )
584
584
assert output . include? ( 't.datetime "this_is_an_alias_of_datetime"' )
585
585
assert output . include? ( 't.timestamp "without_time_zone"' )
@@ -607,7 +607,7 @@ def down
607
607
end
608
608
migration . migrate ( :up )
609
609
610
- output = dump_all_table_schema
610
+ output = dump_table_schema ( "timestamps" )
611
611
assert output . include? ( 't.datetime "this_should_remain_datetime"' )
612
612
assert output . include? ( 't.datetime "this_is_an_alias_of_datetime"' )
613
613
assert output . include? ( 't.datetime "this_is_also_an_alias_of_datetime"' )
@@ -634,7 +634,7 @@ def down
634
634
end
635
635
migration . migrate ( :up )
636
636
637
- output = dump_all_table_schema
637
+ output = dump_table_schema ( "timestamps" )
638
638
# Normally we'd write `t.datetime` here. But because you've changed the `datetime_type`
639
639
# to something else, `t.datetime` now means `:timestamptz`. To ensure that old columns
640
640
# are still created as a `:timestamp` we need to change what is written to the schema dump.
@@ -668,15 +668,15 @@ def down
668
668
end
669
669
migration . migrate ( :up )
670
670
671
- output = dump_all_table_schema
671
+ output = dump_table_schema ( "timestamps" )
672
672
assert output . include? ( 't.datetime "default_format"' )
673
673
assert output . include? ( 't.datetime "without_time_zone"' )
674
674
assert output . include? ( 't.timestamptz "with_time_zone"' )
675
675
676
676
datetime_type_was = ActiveRecord ::ConnectionAdapters ::PostgreSQLAdapter . datetime_type
677
677
ActiveRecord ::ConnectionAdapters ::PostgreSQLAdapter . datetime_type = :timestamptz
678
678
679
- output = dump_all_table_schema
679
+ output = dump_table_schema ( "timestamps" )
680
680
assert output . include? ( 't.timestamp "default_format"' )
681
681
assert output . include? ( 't.timestamp "without_time_zone"' )
682
682
assert output . include? ( 't.datetime "with_time_zone"' )
@@ -704,7 +704,7 @@ def down
704
704
end
705
705
migration . migrate ( :up )
706
706
707
- output = dump_all_table_schema
707
+ output = dump_table_schema ( "timestamps" )
708
708
assert output . include? ( 't.datetime "default_format"' )
709
709
assert output . include? ( 't.datetime "without_time_zone"' )
710
710
assert output . include? ( 't.datetime "also_without_time_zone"' )
@@ -732,7 +732,7 @@ def down
732
732
end
733
733
migration . migrate ( :up )
734
734
735
- output = dump_all_table_schema
735
+ output = dump_table_schema ( "timestamps" )
736
736
assert output . include? ( 't.datetime "default_format"' )
737
737
assert output . include? ( 't.datetime "without_time_zone"' )
738
738
assert output . include? ( 't.datetime "also_without_time_zone"' )
@@ -759,7 +759,7 @@ def down
759
759
end
760
760
migration . migrate ( :up )
761
761
762
- output = dump_all_table_schema
762
+ output = dump_table_schema ( "timestamps" )
763
763
assert output . include? ( 't.datetime "default_format"' )
764
764
assert output . include? ( 't.datetime "without_time_zone"' )
765
765
assert output . include? ( 't.datetime "also_without_time_zone"' )
@@ -785,7 +785,7 @@ def down
785
785
end
786
786
migration . migrate ( :up )
787
787
788
- output = dump_all_table_schema
788
+ output = dump_table_schema ( "timestamps" )
789
789
# Normally we'd write `t.datetime` here. But because you've changed the `datetime_type`
790
790
# to something else, `t.datetime` now means `:timestamptz`. To ensure that old columns
791
791
# are still created as a `:timestamp` we need to change what is written to the schema dump.
@@ -818,7 +818,7 @@ def down
818
818
end
819
819
migration . migrate ( :up )
820
820
821
- output = dump_all_table_schema
821
+ output = dump_table_schema ( "timestamps" )
822
822
# Normally we'd write `t.datetime` here. But because you've changed the `datetime_type`
823
823
# to something else, `t.datetime` now means `:timestamptz`. To ensure that old columns
824
824
# are still created as a `:timestamp` we need to change what is written to the schema dump.
0 commit comments