mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: add command to move blob from local to db (#2026)
* Add `mvrss` command to move blob from local to db * Add comment for mvrss command
This commit is contained in:
@@ -36,9 +36,11 @@ type FindResource struct {
|
||||
}
|
||||
|
||||
type UpdateResource struct {
|
||||
ID int
|
||||
UpdatedTs *int64
|
||||
Filename *string
|
||||
ID int
|
||||
UpdatedTs *int64
|
||||
Filename *string
|
||||
InternalPath *string
|
||||
Blob []byte
|
||||
}
|
||||
|
||||
type DeleteResource struct {
|
||||
@@ -174,6 +176,12 @@ func (s *Store) UpdateResource(ctx context.Context, update *UpdateResource) (*Re
|
||||
if v := update.Filename; v != nil {
|
||||
set, args = append(set, "filename = ?"), append(args, *v)
|
||||
}
|
||||
if v := update.InternalPath; v != nil {
|
||||
set, args = append(set, "internal_path = ?"), append(args, *v)
|
||||
}
|
||||
if v := update.Blob; v != nil {
|
||||
set, args = append(set, "blob = ?"), append(args, v)
|
||||
}
|
||||
|
||||
args = append(args, update.ID)
|
||||
fields := []string{"id", "filename", "external_link", "type", "size", "creator_id", "created_ts", "updated_ts", "internal_path"}
|
||||
|
Reference in New Issue
Block a user