diff options
author | BonfaceKilz | 2021-06-07 19:44:00 +0300 |
---|---|---|
committer | zsloan | 2021-06-18 22:08:04 +0000 |
commit | bb55cf948974d85fb31d2f424f7ee94f7ab5e3d6 (patch) | |
tree | 7e66ebe7ad446ff6e99bdcb4871ddf474fccf3a3 | |
parent | e67316601be4b43da6f60322fef1f4ce15ed5905 (diff) | |
download | genenetwork3-bb55cf948974d85fb31d2f424f7ee94f7ab5e3d6.tar.gz |
Rename json_data column to json_diff_data
-rw-r--r-- | gn3/db/metadata_audit.py | 2 | ||||
-rw-r--r-- | sql/metadata_audit.sql | 12 | ||||
-rw-r--r-- | tests/unit/db/test_audit.py | 2 |
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"}')) |