@@ -86,48 +86,6 @@ def test_rename_table_does_not_rename_custom_named_index
86
86
87
87
assert_equal [ "special_url_idx" ] , connection . indexes ( :octopi ) . map ( &:name )
88
88
end
89
-
90
- if current_adapter? ( :PostgreSQLAdapter )
91
- def test_rename_table_for_postgresql_should_also_rename_default_sequence
92
- rename_table :test_models , :octopi
93
-
94
- pk , seq = connection . pk_and_sequence_for ( "octopi" )
95
-
96
- assert_equal ConnectionAdapters ::PostgreSQL ::Name . new ( "public" , "octopi_#{ pk } _seq" ) , seq
97
- end
98
-
99
- def test_renaming_table_renames_primary_key
100
- connection . create_table :cats , id : :uuid , default : "uuid_generate_v4()"
101
- rename_table :cats , :felines
102
-
103
- assert connection . table_exists? :felines
104
- assert_not connection . table_exists? :cats
105
-
106
- primary_key_name = connection . select_values ( <<~SQL , "SCHEMA" ) [ 0 ]
107
- SELECT c.relname
108
- FROM pg_class c
109
- JOIN pg_index i
110
- ON c.oid = i.indexrelid
111
- WHERE i.indisprimary
112
- AND i.indrelid = 'felines'::regclass
113
- SQL
114
-
115
- assert_equal "felines_pkey" , primary_key_name
116
- ensure
117
- connection . drop_table :cats , if_exists : true
118
- connection . drop_table :felines , if_exists : true
119
- end
120
-
121
- def test_renaming_table_doesnt_attempt_to_rename_non_existent_sequences
122
- connection . create_table :cats , id : :uuid , default : "uuid_generate_v4()"
123
- assert_nothing_raised { rename_table :cats , :felines }
124
- assert connection . table_exists? :felines
125
- assert_not connection . table_exists? :cats
126
- ensure
127
- connection . drop_table :cats , if_exists : true
128
- connection . drop_table :felines , if_exists : true
129
- end
130
- end
131
89
end
132
90
end
133
91
end
0 commit comments