mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-17 13:17:20 +08:00
Go: fix db alignment (#16964)
### Summary Align go db schema with python --------- Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@@ -25,6 +25,8 @@ type FileCommit struct {
|
||||
AuthorID string `gorm:"column:author_id;size:32;not null;index" json:"author_id"`
|
||||
FileCount int `gorm:"column:file_count;default:0" json:"file_count"`
|
||||
TreeState *string `gorm:"column:tree_state;type:longtext" json:"tree_state,omitempty"`
|
||||
Title *string `gorm:"column:title;size:255" json:"title,omitempty"`
|
||||
Comments *string `gorm:"column:comments;type:longtext" json:"comments,omitempty"`
|
||||
BaseModel
|
||||
}
|
||||
|
||||
@@ -35,16 +37,22 @@ func (FileCommit) TableName() string {
|
||||
|
||||
// FileCommitItem represents a single file change within a commit.
|
||||
type FileCommitItem struct {
|
||||
ID string `gorm:"column:id;primaryKey;size:32" json:"id"`
|
||||
CommitID string `gorm:"column:commit_id;size:32;not null;uniqueIndex:idx_commit_file" json:"commit_id"`
|
||||
FileID string `gorm:"column:file_id;size:32;not null;uniqueIndex:idx_commit_file" json:"file_id"`
|
||||
Operation string `gorm:"column:operation;size:16;not null;index" json:"operation"`
|
||||
OldHash *string `gorm:"column:old_hash;size:64;index" json:"old_hash,omitempty"`
|
||||
NewHash *string `gorm:"column:new_hash;size:64;index" json:"new_hash,omitempty"`
|
||||
OldLocation *string `gorm:"column:old_location;size:255" json:"old_location,omitempty"`
|
||||
NewLocation *string `gorm:"column:new_location;size:255" json:"new_location,omitempty"`
|
||||
OldName *string `gorm:"column:old_name;size:255" json:"old_name,omitempty"`
|
||||
NewName *string `gorm:"column:new_name;size:255" json:"new_name,omitempty"`
|
||||
ID string `gorm:"column:id;primaryKey;size:32" json:"id"`
|
||||
CommitID string `gorm:"column:commit_id;size:32;not null;uniqueIndex:idx_commit_file" json:"commit_id"`
|
||||
FileID string `gorm:"column:file_id;size:32;not null;uniqueIndex:idx_commit_file" json:"file_id"`
|
||||
Operation string `gorm:"column:operation;size:16;not null;index" json:"operation"`
|
||||
OldHash *string `gorm:"column:old_hash;size:64;index" json:"old_hash,omitempty"`
|
||||
NewHash *string `gorm:"column:new_hash;size:64;index" json:"new_hash,omitempty"`
|
||||
OldLocation *string `gorm:"column:old_location;size:255" json:"old_location,omitempty"`
|
||||
NewLocation *string `gorm:"column:new_location;size:255" json:"new_location,omitempty"`
|
||||
OldName *string `gorm:"column:old_name;size:255" json:"old_name,omitempty"`
|
||||
NewName *string `gorm:"column:new_name;size:255" json:"new_name,omitempty"`
|
||||
Diff *string `gorm:"column:diff;type:longtext" json:"diff,omitempty"`
|
||||
ContentAfterStorage *string `gorm:"column:content_after_storage;size:16;index" json:"content_after_storage,omitempty"`
|
||||
ContentAfterLocation *string `gorm:"column:content_after_location;size:512" json:"content_after_location,omitempty"`
|
||||
SlugKwd *string `gorm:"column:slug_kwd;size:512;index" json:"slug_kwd,omitempty"`
|
||||
PageTypeKwd *string `gorm:"column:page_type_kwd;size:32;index" json:"page_type_kwd,omitempty"`
|
||||
|
||||
BaseModel
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user