Skip to content

Commit 4e1eb7b

Browse files
committed
Fix linter error
1 parent 1180a0d commit 4e1eb7b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

sql/primary_keys_with_serial_types.sql

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
-- and https://stackoverflow.com/questions/55300370/postgresql-serial-vs-identity
1414
with
1515
nsp as (
16-
select
17-
nsp.oid
16+
select nsp.oid
1817
from pg_catalog.pg_namespace nsp
1918
where
2019
nsp.nspname = :schema_name_param::text
@@ -25,20 +24,20 @@ with
2524
col.attrelid::regclass::text as table_name,
2625
col.attname::text as column_name,
2726
col.attnotnull as column_not_null,
27+
s.seqrelid::regclass::text as sequence_name,
2828
case col.atttypid
2929
when 'int'::regtype then 'serial'
3030
when 'int8'::regtype then 'bigserial'
3131
when 'int2'::regtype then 'smallserial'
3232
end as column_type,
33-
s.seqrelid::regclass::text as sequence_name,
3433
pg_get_expr(ad.adbin, ad.adrelid) as column_default_value
3534
from
3635
pg_catalog.pg_class t
3736
inner join nsp on nsp.oid = t.relnamespace
3837
inner join pg_catalog.pg_attribute col on col.attrelid = t.oid
3938
inner join pg_catalog.pg_constraint c on c.conrelid = col.attrelid and col.attnum = any(c.conkey)
4039
inner join pg_catalog.pg_attrdef ad on ad.adrelid = col.attrelid and ad.adnum = col.attnum
41-
inner join pg_catalog.pg_depend dep on dep.refobjid = col.attrelid AND dep.refobjsubid = col.attnum
40+
inner join pg_catalog.pg_depend dep on dep.refobjid = col.attrelid and dep.refobjsubid = col.attnum
4241
inner join pg_catalog.pg_sequence s on s.seqrelid = dep.objid
4342
where
4443
col.atttypid = any('{int,int8,int2}'::regtype[]) and

0 commit comments

Comments
 (0)