Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9bcff30

Browse files
authored
fix(coderd/database): migrate workspaces.last_used_at to timestamptz (#9699)
1 parent1f5eb08 commit9bcff30

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

‎coderd/database/dump.sql‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ALTERTABLE ONLY workspaces
2+
ALTER COLUMN last_used_at
3+
SET DATA TYPEtimestamp
4+
USING last_used_at::timestamptz ATTIME ZONE'UTC',
5+
ALTER COLUMN last_used_at
6+
SET DEFAULT'0001-01-01 00:00:00'::timestamp;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ALTERTABLE ONLY workspaces
2+
ALTER COLUMN last_used_at
3+
SET DATA TYPEtimestamptz
4+
USING last_used_at::timestamp ATTIME ZONE'UTC',
5+
ALTER COLUMN last_used_at
6+
SET DEFAULT'0001-01-01 00:00:00+00:00'::timestamptz;

‎coderd/workspaces_test.go‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,12 +1515,8 @@ func TestWorkspaceFilterManual(t *testing.T) {
15151515
t.Run("LastUsed",func(t*testing.T) {
15161516
t.Parallel()
15171517

1518-
// nolint:gocritic // https://github.com/coder/coder/issues/9682
1519-
db,ps:=dbtestutil.NewDB(t,dbtestutil.WithTimezone("UTC"))
15201518
client,_,api:=coderdtest.NewWithAPI(t,&coderdtest.Options{
15211519
IncludeProvisionerDaemon:true,
1522-
Database:db,
1523-
Pubsub:ps,
15241520
})
15251521
user:=coderdtest.CreateFirstUser(t,client)
15261522
authToken:=uuid.NewString()

‎enterprise/coderd/templates_test.go‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"github.com/coder/coder/v2/coderd/audit"
1414
"github.com/coder/coder/v2/coderd/coderdtest"
1515
"github.com/coder/coder/v2/coderd/database"
16-
"github.com/coder/coder/v2/coderd/database/dbtestutil"
1716
"github.com/coder/coder/v2/coderd/rbac"
1817
"github.com/coder/coder/v2/codersdk"
1918
"github.com/coder/coder/v2/cryptorand"
@@ -369,14 +368,10 @@ func TestTemplates(t *testing.T) {
369368
t.Run("UpdateLastUsedAt",func(t*testing.T) {
370369
t.Parallel()
371370

372-
// nolint:gocritic // https://github.com/coder/coder/issues/9682
373-
db,ps:=dbtestutil.NewDB(t,dbtestutil.WithTimezone("UTC"))
374371
ctx:=testutil.Context(t,testutil.WaitMedium)
375372
client,user:=coderdenttest.New(t,&coderdenttest.Options{
376373
Options:&coderdtest.Options{
377374
IncludeProvisionerDaemon:true,
378-
Database:db,
379-
Pubsub:ps,
380375
},
381376
LicenseOptions:&coderdenttest.LicenseOptions{
382377
Features: license.Features{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp