diff --git a/lints/0020_table_bloat.sql b/lints/0020_table_bloat.sql index 76e69be..0704a84 100644 --- a/lints/0020_table_bloat.sql +++ b/lints/0020_table_bloat.sql @@ -69,7 +69,7 @@ bloat_data as ( select 'table_bloat' as name, 'Table Bloat' as title, - 'INFO' as level, + 'WARN' as level, 'EXTERNAL' as facing, array['PERFORMANCE'] as categories, 'Detects if a table has excess bloat and may benefit from maintenance operations like vacuum full or cluster.' as description, @@ -78,7 +78,7 @@ select bloat_data.schemaname, bloat_data.object_name ) as detail, - 'Consider running vacuum full (WARNING: incurs downtime) and tweaking autovacuum settings to reduce bloat.' as remediation, + 'https://supabase.com/docs/guides/database/database-linter?lint=0020_table_bloat' as remediation, jsonb_build_object( 'schema', bloat_data.schemaname, 'name', bloat_data.object_name, diff --git a/lints/0021_fkey_to_auth_unique.sql b/lints/0021_fkey_to_auth_unique.sql index a3c308f..dc93aa1 100644 --- a/lints/0021_fkey_to_auth_unique.sql +++ b/lints/0021_fkey_to_auth_unique.sql @@ -13,7 +13,7 @@ select c_rel.relname, -- referencing table c.conname -- fkey name ) as detail, - 'Drop the foreign key constraint that references the auth schema.' as remediation, + 'https://supabase.com/docs/guides/database/database-linter?lint=0021_fkey_to_auth_unique' as remediation, jsonb_build_object( 'schema', n.nspname, 'name', c_rel.relname, diff --git a/splinter.sql b/splinter.sql index 9cd66c9..3c25786 100644 --- a/splinter.sql +++ b/splinter.sql @@ -1074,7 +1074,7 @@ bloat_data as ( select 'table_bloat' as name, 'Table Bloat' as title, - 'INFO' as level, + 'WARN' as level, 'EXTERNAL' as facing, array['PERFORMANCE'] as categories, 'Detects if a table has excess bloat and may benefit from maintenance operations like vacuum full or cluster.' as description, @@ -1083,7 +1083,7 @@ select bloat_data.schemaname, bloat_data.object_name ) as detail, - 'Consider running vacuum full (WARNING: incurs downtime) and tweaking autovacuum settings to reduce bloat.' as remediation, + 'https://supabase.com/docs/guides/database/database-linter?lint=0020_table_bloat' as remediation, jsonb_build_object( 'schema', bloat_data.schemaname, 'name', bloat_data.object_name, @@ -1117,7 +1117,7 @@ select c_rel.relname, -- referencing table c.conname -- fkey name ) as detail, - 'Drop the foreign key constraint that references the auth schema.' as remediation, + 'https://supabase.com/docs/guides/database/database-linter?lint=0021_fkey_to_auth_unique' as remediation, jsonb_build_object( 'schema', n.nspname, 'name', c_rel.relname, diff --git a/test/expected/0021_fkey_to_auth_unique.out b/test/expected/0021_fkey_to_auth_unique.out index d854884..be1fd88 100644 --- a/test/expected/0021_fkey_to_auth_unique.out +++ b/test/expected/0021_fkey_to_auth_unique.out @@ -12,9 +12,9 @@ begin; ); -- 1 issue - fkey ref to unique constraint select * from lint."0021_fkey_to_auth_unique"; - name | title | level | facing | categories | description | detail | remediation | metadata | cache_key ----------------------+---------------------------------------+-------+----------+------------+-----------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+------------------------------------------------------------------+-------------------------------------------------------------------+-------------------------------------------- - fkey_to_auth_unique | Foreign Key to Auth Unique Constraint | ERROR | EXTERNAL | {SECURITY} | Detects user defined foreign keys to unique constraints in the auth schema. | Table `public`.`foo` has a foreign key `foo_un_fkey` referencing an auth unique constraint | Drop the foreign key constraint that references the auth schema. | {"name": "foo", "schema": "public", "foreign_key": "foo_un_fkey"} | fkey_to_auth_unique_public_foo_foo_un_fkey + name | title | level | facing | categories | description | detail | remediation | metadata | cache_key +---------------------+---------------------------------------+-------+----------+------------+-----------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------+-------------------------------------------- + fkey_to_auth_unique | Foreign Key to Auth Unique Constraint | ERROR | EXTERNAL | {SECURITY} | Detects user defined foreign keys to unique constraints in the auth schema. | Table `public`.`foo` has a foreign key `foo_un_fkey` referencing an auth unique constraint | https://supabase.com/docs/guides/database/database-linter?lint=0021_fkey_to_auth_unique | {"name": "foo", "schema": "public", "foreign_key": "foo_un_fkey"} | fkey_to_auth_unique_public_foo_foo_un_fkey (1 row) -- Alter the table adding another fkey based on id @@ -26,9 +26,9 @@ begin; references auth.users(id); -- 1 issue - still only 1 issue because the pkey constraint is okay select * from lint."0021_fkey_to_auth_unique"; - name | title | level | facing | categories | description | detail | remediation | metadata | cache_key ----------------------+---------------------------------------+-------+----------+------------+-----------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+------------------------------------------------------------------+-------------------------------------------------------------------+-------------------------------------------- - fkey_to_auth_unique | Foreign Key to Auth Unique Constraint | ERROR | EXTERNAL | {SECURITY} | Detects user defined foreign keys to unique constraints in the auth schema. | Table `public`.`foo` has a foreign key `foo_un_fkey` referencing an auth unique constraint | Drop the foreign key constraint that references the auth schema. | {"name": "foo", "schema": "public", "foreign_key": "foo_un_fkey"} | fkey_to_auth_unique_public_foo_foo_un_fkey + name | title | level | facing | categories | description | detail | remediation | metadata | cache_key +---------------------+---------------------------------------+-------+----------+------------+-----------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------+-------------------------------------------- + fkey_to_auth_unique | Foreign Key to Auth Unique Constraint | ERROR | EXTERNAL | {SECURITY} | Detects user defined foreign keys to unique constraints in the auth schema. | Table `public`.`foo` has a foreign key `foo_un_fkey` referencing an auth unique constraint | https://supabase.com/docs/guides/database/database-linter?lint=0021_fkey_to_auth_unique | {"name": "foo", "schema": "public", "foreign_key": "foo_un_fkey"} | fkey_to_auth_unique_public_foo_foo_un_fkey (1 row) drop table public.foo;