Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 38cdef4

Browse files
committed
user_agent
1 parent e585f91 commit 38cdef4

File tree

6 files changed

+17
-51
lines changed

6 files changed

+17
-51
lines changed

coderd/database/databasefake/databasefake.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -1632,9 +1632,7 @@ func (q *fakeQuerier) InsertAuditLog(_ context.Context, arg database.InsertAudit
16321632
UserID: arg.UserID,
16331633
OrganizationID: arg.OrganizationID,
16341634
Ip: arg.Ip,
1635-
Os: arg.Os,
1636-
Browser: arg.Browser,
1637-
Device: arg.Device,
1635+
UserAgent: arg.UserAgent,
16381636
ResourceType: arg.ResourceType,
16391637
ResourceID: arg.ResourceID,
16401638
ResourceTarget: arg.ResourceTarget,

coderd/database/dump.sql

+2-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/migrations/000010_audit_logs.up.sql

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ CREATE TABLE audit_logs (
1919
user_id uuid NOT NULL,
2020
organization_id uuid NOT NULL,
2121
ip cidr NOT NULL,
22-
os varchar(64) NOT NULL,
23-
browser varchar(64) NOT NULL,
24-
device varchar(64) NOT NULL,
22+
user_agent varchar(256) NOT NULL,
2523
resource_type resource_type NOT NULL,
2624
resource_id uuid NOT NULL,
25+
-- resource_target is the name of the resource that `resource_id` points to.
26+
-- it's stored here because resources we point to can be deleted.
2727
resource_target text NOT NULL,
2828
action audit_action NOT NULL,
2929
diff jsonb NOT NULL,
30-
status_code integer DEFAULT 0 NOT NULL,
30+
status_code integer NOT NULL,
3131
PRIMARY KEY (id)
3232
);
3333

coderd/database/models.go

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries.sql.go

+7-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/auditlogs.sql

+2-4
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ INSERT INTO
2020
user_id,
2121
organization_id,
2222
ip,
23-
os,
24-
browser,
25-
device,
23+
user_agent,
2624
resource_type,
2725
resource_id,
2826
resource_target,
@@ -31,4 +29,4 @@ INSERT INTO
3129
status_code
3230
)
3331
VALUES
34-
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) RETURNING *;
32+
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) RETURNING *;

0 commit comments

Comments
 (0)