diff --git a/internal/db/schema/internal/postgres/migration_log_test.go b/internal/db/schema/internal/postgres/migration_log_test.go index b1be39a4e..88e6a8d1b 100644 --- a/internal/db/schema/internal/postgres/migration_log_test.go +++ b/internal/db/schema/internal/postgres/migration_log_test.go @@ -59,9 +59,7 @@ func TestEnsureMigrationLog_UpdateForEditionSupport(t *testing.T) { timestamp with time zone default current_timestamp; - create or replace function - default_create_time() - returns trigger + create or replace function default_create_time() returns trigger as $$ begin if new.create_time is distinct from now() then @@ -72,9 +70,7 @@ func TestEnsureMigrationLog_UpdateForEditionSupport(t *testing.T) { end; $$ language plpgsql; - create or replace function - immutable_columns() - returns trigger + create or replace function immutable_columns() returns trigger as $$ declare col_name text; @@ -118,9 +114,7 @@ func TestEnsureMigrationLog_UpdateForEditionSupport(t *testing.T) { update on log_migration for each row execute procedure immutable_columns('id', 'migration_version', 'create_time', 'entry'); - create or replace function - log_migration_version() - returns trigger + create or replace function log_migration_version() returns trigger as $$ declare current_version bigint; begin diff --git a/internal/db/schema/internal/postgres/query.go b/internal/db/schema/internal/postgres/query.go index e21b08cb8..1f5730f66 100644 --- a/internal/db/schema/internal/postgres/query.go +++ b/internal/db/schema/internal/postgres/query.go @@ -120,9 +120,7 @@ alter table log_migration alter column edition drop default; ` migrationLogReplaceVersionTrigger = ` -create or replace function - log_migration_version() - returns trigger +create or replace function log_migration_version() returns trigger as $$ declare current_version bigint; begin diff --git a/internal/db/schema/migrations/base/postgres/02_log_migration.up.sql b/internal/db/schema/migrations/base/postgres/02_log_migration.up.sql index 7f9b45352..9a0da93a4 100644 --- a/internal/db/schema/migrations/base/postgres/02_log_migration.up.sql +++ b/internal/db/schema/migrations/base/postgres/02_log_migration.up.sql @@ -9,9 +9,7 @@ create table log_migration( comment on table log_migration is 'log_migration entries are logging output from database migrations'; -create or replace function - log_migration_version() - returns trigger +create or replace function log_migration_version() returns trigger as $$ declare current_version bigint; begin diff --git a/internal/db/schema/migrations/oss/postgres/43/01_session_credentials.up.sql b/internal/db/schema/migrations/oss/postgres/43/01_session_credentials.up.sql index 1477b86c5..549fa7b8e 100644 --- a/internal/db/schema/migrations/oss/postgres/43/01_session_credentials.up.sql +++ b/internal/db/schema/migrations/oss/postgres/43/01_session_credentials.up.sql @@ -20,8 +20,7 @@ begin; -- session_credentials_sha256_credential sets the credential_sha256 -- to digest(credential, 'sha256') - create function session_credentials_sha256_credential() - returns trigger + create function session_credentials_sha256_credential() returns trigger as $$ begin new.credential_sha256 = digest(new.credential, 'sha256'); diff --git a/internal/db/sqltest/initdb.d/02_wtt_load.sql b/internal/db/sqltest/initdb.d/02_wtt_load.sql index 804f262fe..38ec38a77 100644 --- a/internal/db/sqltest/initdb.d/02_wtt_load.sql +++ b/internal/db/sqltest/initdb.d/02_wtt_load.sql @@ -12,8 +12,7 @@ begin; -- -- Note that some aggregates depend on data from other aggretates, so the order -- that they are passed to this function matters. - create function wtt_load(persona text, variadic aggregates text[]) - returns void + create function wtt_load(persona text, variadic aggregates text[]) returns void as $$ declare agg text; diff --git a/internal/db/sqltest/initdb.d/03_widgets_persona.sql b/internal/db/sqltest/initdb.d/03_widgets_persona.sql index 23b2be74f..9397376fd 100644 --- a/internal/db/sqltest/initdb.d/03_widgets_persona.sql +++ b/internal/db/sqltest/initdb.d/03_widgets_persona.sql @@ -2,8 +2,7 @@ begin; -- _wtt_load_widgets_iam populates all iam_ tables for the widgets persona. -- iam does not depend on any other aggregates, but others depend on it, -- as such is it should be first in the list. - create function _wtt_load_widgets_iam() - returns void + create function _wtt_load_widgets_iam() returns void as $$ begin -- Add organizations @@ -91,8 +90,7 @@ begin; -- _wtt_load_kms populates all kms_ tables for the widgets persona. -- kms depends on iam. - create function _wtt_load_widgets_kms() - returns void + create function _wtt_load_widgets_kms() returns void as $$ begin insert into kms_root_key @@ -130,8 +128,7 @@ begin; -- _wtt_load_widgets_auth populates all auth_ tables for the widgets persona. -- auth depends on iam, and kms. - create function _wtt_load_widgets_auth() - returns void + create function _wtt_load_widgets_auth() returns void as $$ begin insert into auth_password_conf @@ -197,8 +194,7 @@ begin; -- _wtt_load_widgets_hosts populates all host_ tables for the widgets persona. -- hosts depend on iam. - create function _wtt_load_widgets_hosts() - returns void + create function _wtt_load_widgets_hosts() returns void as $$ begin insert into static_host_catalog @@ -312,8 +308,7 @@ begin; -- _wtt_load_widgets_targets populates all target_ tables for the widgets persona. -- targets depend on iam, auth, hosts. - create function _wtt_load_widgets_targets() - returns void + create function _wtt_load_widgets_targets() returns void as $$ begin insert into target_tcp @@ -337,8 +332,7 @@ begin; end; $$ language plpgsql; - create function _wtt_load_widgets_credentials() - returns void + create function _wtt_load_widgets_credentials() returns void as $$ begin insert into credential_vault_store @@ -434,8 +428,7 @@ begin; end; $$ language plpgsql; -create function _wtt_load_widgets_sessions() - returns void +create function _wtt_load_widgets_sessions() returns void as $$ begin insert into session diff --git a/internal/oplog/oplog_test/db.go b/internal/oplog/oplog_test/db.go index ffa159596..61c59f3b1 100644 --- a/internal/oplog/oplog_test/db.go +++ b/internal/oplog/oplog_test/db.go @@ -33,9 +33,7 @@ func Init(t testing.TB, db *dbw.DB) { version wt_version ); - create or replace function - oplog_test_version_column() - returns trigger + create or replace function oplog_test_version_column() returns trigger as $$ begin if pg_trigger_depth() = 1 then