quantranhong1999 commented on code in PR #1848:
URL: https://github.com/apache/james-project/pull/1848#discussion_r1422012777
##########
backends-common/postgres/src/main/java/org/apache/james/backends/postgres/PostgresTableManager.java:
##########
@@ -105,10 +105,14 @@ public Mono<Void> alterTableEnableRLS(PostgresTable
table) {
}
private String rowLevelSecurityAlterStatement(String tableName) {
- return "SET app.current_domain = ''; ALTER TABLE " + tableName + " ADD
DOMAIN varchar(255) not null DEFAULT
current_setting('app.current_domain')::text;" +
Review Comment:
Can just `ADD COLUMN IF NOT EXISTS domain varchar(255)...` IMO.
https://www.postgresql.org/docs/current/sql-altertable.html#SQL-ALTERTABLE-DESC-ADD-COLUMN
no need to use a custom function here IMO.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]