Skip to content

Commit 95d70a3

Browse files
committed
remove system user index
1 parent 0d4813a commit 95d70a3

File tree

3 files changed

+1
-5
lines changed

3 files changed

+1
-5
lines changed

coderd/database/dbmem/dbmem.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ func New() database.Store {
155155
}
156156

157157
q.mutex.Lock()
158+
// We can't insert this user using the interface, because it's a system user.
158159
q.data.users = append(q.data.users, database.User{
159160
ID: prebuilds.SystemUserID,
160161
Email: "prebuilds@coder.com",

coderd/database/migrations/000302_system_user.down.sql

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,5 @@ WHERE user_id = 'c42fdf75-3097-471c-8c33-fb52454d81c0';
4646
DELETE FROM users
4747
WHERE id = 'c42fdf75-3097-471c-8c33-fb52454d81c0';
4848

49-
-- Drop index
50-
DROP INDEX IF EXISTS user_is_system_idx;
51-
5249
-- Drop column
5350
ALTER TABLE users DROP COLUMN IF EXISTS is_system;

coderd/database/migrations/000302_system_user.up.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
ALTER TABLE users
22
ADD COLUMN is_system bool DEFAULT false NOT NULL;
33

4-
CREATE INDEX user_is_system_idx ON users USING btree (is_system);
5-
64
COMMENT ON COLUMN users.is_system IS 'Determines if a user is a system user, and therefore cannot login or perform normal actions';
75

86
INSERT INTO users (id, email, username, name, created_at, updated_at, status, rbac_roles, hashed_password, is_system, login_type)

0 commit comments

Comments
 (0)