-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(physical-backup): Store checksum and size of file during backup
- Loading branch information
Showing
7 changed files
with
143 additions
and
3 deletions.
There are no files selected for viewing
Empty file.
8 changes: 8 additions & 0 deletions
8
press/press/doctype/physical_backup_file_metadata/physical_backup_file_metadata.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Copyright (c) 2025, Frappe and contributors | ||
// For license information, please see license.txt | ||
|
||
// frappe.ui.form.on("Physical Backup File Metadata", { | ||
// refresh(frm) { | ||
|
||
// }, | ||
// }); |
49 changes: 49 additions & 0 deletions
49
press/press/doctype/physical_backup_file_metadata/physical_backup_file_metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"actions": [], | ||
"allow_rename": 1, | ||
"creation": "2025-01-23 19:06:50.174314", | ||
"doctype": "DocType", | ||
"engine": "InnoDB", | ||
"field_order": [ | ||
"file", | ||
"size", | ||
"checksum" | ||
], | ||
"fields": [ | ||
{ | ||
"fieldname": "checksum", | ||
"fieldtype": "Data", | ||
"in_list_view": 1, | ||
"label": "Checksum", | ||
"read_only": 1 | ||
}, | ||
{ | ||
"fieldname": "size", | ||
"fieldtype": "Int", | ||
"in_list_view": 1, | ||
"label": "Size", | ||
"read_only": 1, | ||
"reqd": 1 | ||
}, | ||
{ | ||
"fieldname": "file", | ||
"fieldtype": "Data", | ||
"in_list_view": 1, | ||
"label": "File", | ||
"read_only": 1, | ||
"reqd": 1 | ||
} | ||
], | ||
"index_web_pages_for_search": 1, | ||
"istable": 1, | ||
"links": [], | ||
"modified": "2025-01-23 19:23:33.543343", | ||
"modified_by": "Administrator", | ||
"module": "Press", | ||
"name": "Physical Backup File Metadata", | ||
"owner": "Administrator", | ||
"permissions": [], | ||
"sort_field": "creation", | ||
"sort_order": "DESC", | ||
"states": [] | ||
} |
26 changes: 26 additions & 0 deletions
26
press/press/doctype/physical_backup_file_metadata/physical_backup_file_metadata.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from __future__ import annotations | ||
|
||
# Copyright (c) 2025, Frappe and contributors | ||
# For license information, please see license.txt | ||
# import frappe | ||
from frappe.model.document import Document | ||
|
||
|
||
class PhysicalBackupFileMetadata(Document): | ||
# begin: auto-generated types | ||
# This code is auto-generated. Do not modify anything in this block. | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from frappe.types import DF | ||
|
||
checksum: DF.Data | None | ||
file: DF.Data | ||
parent: DF.Data | ||
parentfield: DF.Data | ||
parenttype: DF.Data | ||
size: DF.Int | ||
# end: auto-generated types | ||
|
||
pass |
29 changes: 29 additions & 0 deletions
29
press/press/doctype/physical_backup_file_metadata/test_physical_backup_file_metadata.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright (c) 2025, Frappe and Contributors | ||
# See license.txt | ||
|
||
# import frappe | ||
from frappe.tests import IntegrationTestCase, UnitTestCase | ||
|
||
# On IntegrationTestCase, the doctype test records and all | ||
# link-field test record depdendencies are recursively loaded | ||
# Use these module variables to add/remove to/from that list | ||
EXTRA_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"] | ||
IGNORE_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"] | ||
|
||
|
||
class UnitTestPhysicalBackupFileMetadata(UnitTestCase): | ||
""" | ||
Unit tests for PhysicalBackupFileMetadata. | ||
Use this class for testing individual functions and methods. | ||
""" | ||
|
||
pass | ||
|
||
|
||
class IntegrationTestPhysicalBackupFileMetadata(IntegrationTestCase): | ||
""" | ||
Integration tests for PhysicalBackupFileMetadata. | ||
Use this class for testing interactions between multiple components. | ||
""" | ||
|
||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters