From c39e08972dbc2a5eac074c50de54b86c50e74f14 Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Wed, 7 Jul 2021 12:42:01 -0400 Subject: [PATCH 1/5] Change irb_documents to documents --- crc/services/document_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crc/services/document_service.py b/crc/services/document_service.py index 1626cc59..c7437eb9 100644 --- a/crc/services/document_service.py +++ b/crc/services/document_service.py @@ -11,7 +11,7 @@ class DocumentService(object): the spreadsheet should contain the columns 'code', 'category1', 'category2', 'category3', 'description' and 'id', code is required for all rows in the table, the other fields are optional. """ - DOCUMENT_LIST = "irb_documents.xlsx" + DOCUMENT_LIST = "documents.xlsx" @staticmethod def is_allowed_document(code): From 23180908c8b70364c404249ab489ef3fa255da61 Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Wed, 7 Jul 2021 12:43:51 -0400 Subject: [PATCH 2/5] Undo change. Wrong branch --- crc/services/document_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crc/services/document_service.py b/crc/services/document_service.py index c7437eb9..1626cc59 100644 --- a/crc/services/document_service.py +++ b/crc/services/document_service.py @@ -11,7 +11,7 @@ class DocumentService(object): the spreadsheet should contain the columns 'code', 'category1', 'category2', 'category3', 'description' and 'id', code is required for all rows in the table, the other fields are optional. """ - DOCUMENT_LIST = "documents.xlsx" + DOCUMENT_LIST = "irb_documents.xlsx" @staticmethod def is_allowed_document(code): From d6f9b013f70daf9ca49bf3add30cad6afb469de8 Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Wed, 7 Jul 2021 12:54:03 -0400 Subject: [PATCH 3/5] Change `irb_documents` to `documents` --- crc/services/document_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crc/services/document_service.py b/crc/services/document_service.py index 1626cc59..c7437eb9 100644 --- a/crc/services/document_service.py +++ b/crc/services/document_service.py @@ -11,7 +11,7 @@ class DocumentService(object): the spreadsheet should contain the columns 'code', 'category1', 'category2', 'category3', 'description' and 'id', code is required for all rows in the table, the other fields are optional. """ - DOCUMENT_LIST = "irb_documents.xlsx" + DOCUMENT_LIST = "documents.xlsx" @staticmethod def is_allowed_document(code): From f1a15ef8e9757efaede9a4e7bccdfe22c08b3787 Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Wed, 7 Jul 2021 12:54:16 -0400 Subject: [PATCH 4/5] Fix the test --- tests/files/test_files_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/files/test_files_api.py b/tests/files/test_files_api.py index aa23ac45..8506952e 100644 --- a/tests/files/test_files_api.py +++ b/tests/files/test_files_api.py @@ -112,7 +112,7 @@ class TestFilesApi(BaseTest): self.assertEqual(0, len(json.loads(rv.get_data(as_text=True)))) def test_set_reference_file(self): - file_name = "irb_documents.xlsx" + file_name = "documents.xlsx" filepath = os.path.join(app.root_path, 'static', 'reference', 'irb_documents.xlsx') with open(filepath, 'rb') as myfile: file_data = myfile.read() From 1c9db16bffabcd0ae3240a38c86d93d970b41335 Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Wed, 7 Jul 2021 13:27:57 -0400 Subject: [PATCH 5/5] Migration to change filename from `irb_documents` to `documents` in the database --- migrations/versions/c16d3047abbe_.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 migrations/versions/c16d3047abbe_.py diff --git a/migrations/versions/c16d3047abbe_.py b/migrations/versions/c16d3047abbe_.py new file mode 100644 index 00000000..4deb56b3 --- /dev/null +++ b/migrations/versions/c16d3047abbe_.py @@ -0,0 +1,25 @@ +"""change irb_documents to documents + +Revision ID: c16d3047abbe +Revises: bbf064082623 +Create Date: 2021-07-07 13:07:53.966102 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'c16d3047abbe' +down_revision = 'bbf064082623' +branch_labels = None +depends_on = None + + +def upgrade(): + pass + op.execute("update file set name = 'documents.xlsx' where name='irb_documents.xlsx'") + + +def downgrade(): + op.execute("update file set name = 'irb_documents.xlsx' where name='documents.xlsx'")