Compare commits

...

2 Commits

Author SHA1 Message Date
  lewis 8f1cb52042 del unneed 3 years ago
  lewis ab8d4c9369 debug 3 years ago
3 changed files with 14 additions and 16 deletions
Unified View
  1. +1
    -3
      models/custom_migrations.go
  2. +12
    -12
      models/file_chunk.go
  3. +1
    -1
      routers/init.go

+ 1
- 3
models/custom_migrations.go View File

@@ -15,9 +15,7 @@ type CustomMigrationStatic struct {
Migrate func(*xorm.Engine, *xorm.Engine) error Migrate func(*xorm.Engine, *xorm.Engine) error
} }


var customMigrations = []CustomMigration{
{"Custom v1 Topic struct change to support chinese", syncTopicStruct},
}
var customMigrations []CustomMigration


var customMigrationsStatic = []CustomMigrationStatic{ var customMigrationsStatic = []CustomMigrationStatic{
{"update issue_fixed_rate to 1 if num_issues is 0 ", updateIssueFixedRate}, {"update issue_fixed_rate to 1 if num_issues is 0 ", updateIssueFixedRate},


+ 12
- 12
models/file_chunk.go View File

@@ -14,18 +14,18 @@ const (
) )


type FileChunk struct { type FileChunk struct {
ID int64 `xorm:"pk autoincr"`
UUID string `xorm:"uuid UNIQUE"`
Md5 string `xorm:"INDEX"`
IsUploaded int `xorm:"DEFAULT 0"` // not uploaded: 0, uploaded: 1
UploadID string `xorm:"UNIQUE"` //minio upload id
TotalChunks int
Size int64
UserID int64 `xorm:"INDEX"`
Type int `xorm:"INDEX DEFAULT 0"`
CompletedParts []string `xorm:"DEFAULT ''"` // chunkNumber+etag eg: ,1-asqwewqe21312312.2-123hjkas
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
ID int64 `xorm:"pk autoincr"`
UUID string `xorm:"uuid UNIQUE"`
Md5 string `xorm:"INDEX"`
IsUploaded int `xorm:"DEFAULT 0"` // not uploaded: 0, uploaded: 1
UploadID string `xorm:"UNIQUE"` //minio upload id
TotalChunks int
Size int64
UserID int64 `xorm:"INDEX"`
Type int `xorm:"INDEX DEFAULT 0"`
//CompletedParts []string `xorm:"DEFAULT ''"` // chunkNumber+etag eg: ,1-asqwewqe21312312.2-123hjkas
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
} }


// GetFileChunkByMD5 returns fileChunk by given id // GetFileChunkByMD5 returns fileChunk by given id


+ 1
- 1
routers/init.go View File

@@ -58,7 +58,7 @@ func checkRunMode() {
func NewServices() { func NewServices() {
setting.NewServices() setting.NewServices()
if err := storage.Init(); err != nil { if err := storage.Init(); err != nil {
log.Fatal("storage init failed: %v", err)
//log.Fatal("storage init failed: %v", err)
} }
log.Info("storage init succeed.") log.Info("storage init succeed.")
mailer.NewContext() mailer.NewContext()


Loading…
Cancel
Save