1
1
mirror of https://github.com/go-gitea/gitea synced 2025-12-07 13:28:25 +00:00

chore: add dbfs to migration

This commit is contained in:
Jason Song
2022-11-29 17:19:26 +08:00
parent c1fce2cf7d
commit 8f2efdaf60
3 changed files with 39 additions and 19 deletions

View File

@@ -144,6 +144,24 @@ func addBotTables(x *xorm.Engine) error {
Updated timeutil.TimeStamp `xorm:"updated"`
}
type dbfsMeta struct {
ID int64 `xorm:"pk autoincr"`
FullPath string `xorm:"VARCHAR(500) UNIQUE NOT NULL"`
BlockSize int64 `xorm:"BIGINT NOT NULL"`
FileSize int64 `xorm:"BIGINT NOT NULL"`
CreateTimestamp int64 `xorm:"BIGINT NOT NULL"`
ModifyTimestamp int64 `xorm:"BIGINT NOT NULL"`
}
type dbfsData struct {
ID int64 `xorm:"pk autoincr"`
Revision int64 `xorm:"BIGINT NOT NULL"`
MetaID int64 `xorm:"BIGINT index(meta_offset) NOT NULL"`
BlobOffset int64 `xorm:"BIGINT index(meta_offset) NOT NULL"`
BlobSize int64 `xorm:"BIGINT NOT NULL"`
BlobData []byte `xorm:"BLOB NOT NULL"`
}
return x.Sync(
new(BotRunner),
new(BotRunnerToken),
@@ -153,5 +171,7 @@ func addBotTables(x *xorm.Engine) error {
new(BotRunIndex),
new(BotTask),
new(BotTaskStep),
new(dbfsMeta),
new(dbfsData),
)
}