fix: allow null values in storage_limit column
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
ALTER TABLE families
|
||||
ADD COLUMN storage_limit BIGINT;
|
||||
ADD COLUMN storage_limit BIGINT NULL;
|
||||
@@ -232,7 +232,7 @@ func (c *Controller) ModifyMemberStorage(ctx context.Context, actorUserID int64,
|
||||
}
|
||||
}
|
||||
|
||||
modifyStorageErr := c.FamilyRepo.ModifyMemberStorage(ctx, actorUserID, member.ID, storageLimit)
|
||||
modifyStorageErr := c.FamilyRepo.ModifyMemberStorage(ctx, member.ID, storageLimit)
|
||||
if modifyStorageErr != nil {
|
||||
return stacktrace.Propagate(modifyStorageErr, "Failed to modify members storage")
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ func (repo *FamilyRepository) RemoveMember(ctx context.Context, adminID int64, m
|
||||
}
|
||||
|
||||
// UpdateStorage is used to set Pre-existing Members Storage Limit.
|
||||
func (repo *FamilyRepository) ModifyMemberStorage(ctx context.Context, adminID int64, id uuid.UUID, storageLimit *int64) error {
|
||||
func (repo *FamilyRepository) ModifyMemberStorage(ctx context.Context, id uuid.UUID, storageLimit *int64) error {
|
||||
_, err := repo.DB.Exec(`UPDATE families SET storage_limit=$1 where id=$2`, storageLimit, id)
|
||||
if err != nil {
|
||||
return stacktrace.Propagate(err, "Could not update Members Storage Limit")
|
||||
|
||||
Reference in New Issue
Block a user