loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: extend `forgejo_auth_token` table (part two)

Add the default value of the purpose field to both the table and the
migration. The table in v9 and v7 backport already have the default
value.

ALTER TABLE `forgejo_auth_token` ADD `purpose` TEXT NOT NULL [] - Cannot add a NOT NULL column with default value NULL

+2 -2
+1 -1
models/auth/auth_token.go
··· 39 39 UID int64 `xorm:"INDEX"` 40 40 LookupKey string `xorm:"INDEX UNIQUE"` 41 41 HashedValidator string 42 - Purpose AuthorizationPurpose `xorm:"NOT NULL"` 42 + Purpose AuthorizationPurpose `xorm:"NOT NULL DEFAULT 'long_term_authorization'"` 43 43 Expiry timeutil.TimeStamp 44 44 } 45 45
+1 -1
models/forgejo_migrations/v24.go
··· 8 8 func AddPurposeToForgejoAuthToken(x *xorm.Engine) error { 9 9 type ForgejoAuthToken struct { 10 10 ID int64 `xorm:"pk autoincr"` 11 - Purpose string `xorm:"NOT NULL"` 11 + Purpose string `xorm:"NOT NULL DEFAULT 'long_term_authorization'"` 12 12 } 13 13 if err := x.Sync(new(ForgejoAuthToken)); err != nil { 14 14 return err