aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBonfaceKilz2021-06-07 19:44:00 +0300
committerBonfaceKilz2021-06-07 19:58:44 +0300
commita364496e9884e46080844bd3eddb2b52d6ed9164 (patch)
treeacc173670ff8547281395aa829634b00569da497
parent284e7aba7860783cec271471fd2c6f0078805965 (diff)
downloadgenenetwork3-a364496e9884e46080844bd3eddb2b52d6ed9164.tar.gz
Rename json_data column to json_diff_data
-rw-r--r--gn3/db/metadata_audit.py2
-rw-r--r--sql/metadata_audit.sql12
-rw-r--r--tests/unit/db/test_audit.py2
3 files changed, 8 insertions, 8 deletions
diff --git a/gn3/db/metadata_audit.py b/gn3/db/metadata_audit.py
index 8765738..9c4474d 100644
--- a/gn3/db/metadata_audit.py
+++ b/gn3/db/metadata_audit.py
@@ -23,6 +23,6 @@ metadata_audit_mapping = {
"id_": "id",
"dataset_id": "dataset_id",
"editor": "editor",
- "json_data": "json_data",
+ "json_data": "json_diff_data",
"time_stamp": "time_stamp",
}
diff --git a/sql/metadata_audit.sql b/sql/metadata_audit.sql
index 9771e74..514a2fc 100644
--- a/sql/metadata_audit.sql
+++ b/sql/metadata_audit.sql
@@ -20,10 +20,10 @@
-- This table stores data on diffs when editing a Published dataset's data
CREATE TABLE metadata_audit (
PRIMARY KEY (id),
- id INTEGER AUTO_INCREMENT NOT NULL,
- dataset_id INTEGER NOT NULL,
- editor VARCHAR(255) NOT NULL,
- json_data VARCHAR(2048) NOT NULL,
- time_stamp timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,
- CHECK (JSON_VALID(json_data))
+ id INTEGER AUTO_INCREMENT NOT NULL,
+ dataset_id INTEGER NOT NULL,
+ editor VARCHAR(255) NOT NULL,
+ json_diff_data VARCHAR(2048) NOT NULL,
+ time_stamp timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ CHECK (JSON_VALID(json_diff_data))
);
diff --git a/tests/unit/db/test_audit.py b/tests/unit/db/test_audit.py
index 1449281..7480169 100644
--- a/tests/unit/db/test_audit.py
+++ b/tests/unit/db/test_audit.py
@@ -24,5 +24,5 @@ class TestMetadatAudit(TestCase):
json_data=json.dumps({"a": "b"}))), 1)
cursor.execute.assert_called_once_with(
"INSERT INTO metadata_audit (dataset_id, "
- "editor, json_data) VALUES (%s, %s, %s)",
+ "editor, json_diff_data) VALUES (%s, %s, %s)",
(35, 'Bonface', '{"a": "b"}'))