-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove user details from mediator database (#1304)
Fix #1279
- Loading branch information
1 parent
283441a
commit 11a5a93
Showing
13 changed files
with
89 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-- Copyright 2023 Stacklok, Inc | ||
-- | ||
-- Licensed under the Apache License, Version 2.0 (the "License"); | ||
-- you may not use this file except in compliance with the License. | ||
-- You may obtain a copy of the License at | ||
-- | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
|
||
-- Add personal user details to users table | ||
ALTER TABLE users | ||
ADD COLUMN email TEXT, | ||
ADD COLUMN first_name TEXT, | ||
ADD COLUMN last_name TEXT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-- Copyright 2023 Stacklok, Inc | ||
-- | ||
-- Licensed under the Apache License, Version 2.0 (the "License"); | ||
-- you may not use this file except in compliance with the License. | ||
-- You may obtain a copy of the License at | ||
-- | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
|
||
-- Remove personal user details from users table | ||
ALTER TABLE users | ||
DROP COLUMN IF EXISTS email, | ||
DROP COLUMN IF EXISTS first_name, | ||
DROP COLUMN IF EXISTS last_name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,9 +71,6 @@ func TestCreateUserDBMock(t *testing.T) { | |
ID: 1, | ||
OrganizationID: orgID, | ||
IdentitySubject: "subject1", | ||
Email: sql.NullString{String: "[email protected]", Valid: true}, | ||
FirstName: sql.NullString{String: "Foo", Valid: true}, | ||
LastName: sql.NullString{String: "Bar", Valid: true}, | ||
CreatedAt: time.Now(), | ||
UpdatedAt: time.Now(), | ||
} | ||
|
@@ -98,10 +95,7 @@ func TestCreateUserDBMock(t *testing.T) { | |
store.EXPECT().CreateProvider(gomock.Any(), gomock.Any()) | ||
store.EXPECT(). | ||
CreateUser(gomock.Any(), db.CreateUserParams{OrganizationID: orgID, | ||
IdentitySubject: "subject1", | ||
Email: sql.NullString{String: "[email protected]", Valid: true}, | ||
FirstName: sql.NullString{String: "Foo", Valid: true}, | ||
LastName: sql.NullString{String: "Bar", Valid: true}}). | ||
IdentitySubject: "subject1"}). | ||
Return(returnedUser, nil) | ||
store.EXPECT().AddUserProject(gomock.Any(), db.AddUserProjectParams{UserID: 1, ProjectID: projectID}) | ||
store.EXPECT().AddUserRole(gomock.Any(), db.AddUserRoleParams{UserID: 1, RoleID: 2}) | ||
|
@@ -117,10 +111,7 @@ func TestCreateUserDBMock(t *testing.T) { | |
assert.NoError(t, err) | ||
assert.NotNil(t, res) | ||
assert.Equal(t, int32(1), res.Id) | ||
assert.Equal(t, "[email protected]", *res.Email) | ||
assert.Equal(t, orgID.String(), res.OrganizationId) | ||
assert.Equal(t, "Foo", *res.FirstName) | ||
assert.Equal(t, "Bar", *res.LastName) | ||
}, | ||
}, | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.