@@ -157,39 +157,21 @@ describe('PostgreSqlFormatter', () => {
157157 ` ) ;
158158 } ) ;
159159
160- // Format timestamp as datatype
160+ // Regression test for issues #391 and #618
161+ // PostgreSQL-specific variations of WITH TIME ZONE syntax
161162 it ( 'formats TIMESTAMP WITH TIME ZONE syntax' , ( ) => {
162163 expect (
163164 format (
164- `
165- CREATE TABLE time_table (id INT,
166- created_at TIMESTAMP WITH TIME ZONE,
167- deleted_at TIME WITH TIME ZONE,
168- modified_at TIMESTAMP(0) WITH TIME ZONE);` ,
169- { dataTypeCase : 'lower' }
165+ `create table time_table (id int,
166+ created_at timestamp without time zone,
167+ deleted_at time with time zone,
168+ modified_at timestamp(0) with time zone);` ,
169+ { dataTypeCase : 'upper' }
170170 )
171171 ) . toBe ( dedent `
172- CREATE TABLE time_table (
173- id int,
174- created_at timestamp with time zone,
175- deleted_at time with time zone,
176- modified_at timestamp(0) with time zone
177- );
178- ` ) ;
179- } ) ;
180-
181- // Regression test for issues #391 and #618
182- it ( 'formats TIMESTAMP WITH TIME ZONE syntax' , ( ) => {
183- expect (
184- format ( `
185- CREATE TABLE time_table (id INT,
186- created_at TIMESTAMP WITH TIME ZONE,
187- deleted_at TIME WITH TIME ZONE,
188- modified_at TIMESTAMP(0) WITH TIME ZONE);` )
189- ) . toBe ( dedent `
190- CREATE TABLE time_table (
172+ create table time_table (
191173 id INT,
192- created_at TIMESTAMP WITH TIME ZONE,
174+ created_at TIMESTAMP WITHOUT TIME ZONE,
193175 deleted_at TIME WITH TIME ZONE,
194176 modified_at TIMESTAMP(0) WITH TIME ZONE
195177 );
0 commit comments