diff --git a/components/infra-proxy-service/storage/postgres/automate_infra_server_users.go b/components/infra-proxy-service/storage/postgres/automate_infra_server_users.go index 2bdb107a5f1..b7f9a22d9db 100644 --- a/components/infra-proxy-service/storage/postgres/automate_infra_server_users.go +++ b/components/infra-proxy-service/storage/postgres/automate_infra_server_users.go @@ -123,7 +123,7 @@ func (p *postgres) GetAutomateInfraServerUsers(ctx context.Context, serverId str user := storage.User{} if err := rows.Scan(&user.ID, &user.ServerID, &user.InfraServerUsername, &user.CredentialID, &user.Connector, &user.AutomateUserID, &user.IsServerAdmin, &user.CreatedAt, &user.UpdatedAt); err != nil { - return nil, err // TODO: continue or return?? + return nil, err } users = append(users, user) } diff --git a/components/infra-proxy-service/storage/postgres/migration/sql/06_user_management.up.sql b/components/infra-proxy-service/storage/postgres/migration/sql/06_user_management.up.sql index 23645acf886..9ff63b271be 100644 --- a/components/infra-proxy-service/storage/postgres/migration/sql/06_user_management.up.sql +++ b/components/infra-proxy-service/storage/postgres/migration/sql/06_user_management.up.sql @@ -19,7 +19,7 @@ CREATE INDEX IF NOT EXISTS users_automate_user_id_index ON users (automate_user_ -- create table org_users CREATE TABLE IF NOT EXISTS org_users ( id TEXT PRIMARY KEY, - org_id TEXT NOT NULL references orgs(id) ON DELETE RESTRICT, + org_id TEXT NOT NULL, user_id TEXT NOT NULL references users(id) ON DELETE RESTRICT, is_admin BOOLEAN NOT NULL DEFAULT FALSE ); diff --git a/components/infra-proxy-service/storage/postgres/migration/sql/README.md b/components/infra-proxy-service/storage/postgres/migration/sql/README.md index b7adc24c4f2..238cc79e8ec 100644 --- a/components/infra-proxy-service/storage/postgres/migration/sql/README.md +++ b/components/infra-proxy-service/storage/postgres/migration/sql/README.md @@ -6,3 +6,4 @@ - [`03_rename_column_admin_key_in_orgs.up.sql`](03_rename_column_admin_key_in_orgs.up.sql) - [`04_convert_table_to_human_readable_ids.up.sql`](04_convert_table_to_human_readable_ids.up.sql) - [`05_remove_orgs_pkey.up.sql`](05_remove_orgs_pkey.up.sql) +- [`06_user_management.up.sql`](06_user_management.up.sql)