From 6fd714f06b2f72300e8a76c221e5bc8705e2cfa3 Mon Sep 17 00:00:00 2001 From: Pier-Angelo Gaetani Date: Mon, 9 Dec 2024 11:31:45 +0100 Subject: [PATCH 01/28] new pr workflow --- .github/workflows/docker.yml | 66 ----------------------------- .github/workflows/pr.yaml | 81 ++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 45 -------------------- 3 files changed, 81 insertions(+), 111 deletions(-) delete mode 100644 .github/workflows/docker.yml create mode 100644 .github/workflows/pr.yaml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index f4102dbd4f..0000000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Docker - -on: - push: - branches: ["*"] - tags: ["*"] - -env: - REGISTRY: ghcr.io - REPO: ${{ github.repository }} - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - - permissions: - contents: read - packages: write - - steps: - - name: Check out repository - uses: actions/checkout@v3 - - - name: Generate version.py before building image - run: | - echo -e "__git_commit__ = \"${{ github.sha }}\"\n__time__ = \"$(date)\"" > ./app/version.py - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Log in to container registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Keep Docker happy - run: | - echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} - # This is only here because docker freaks out if the repo/tag that you're pushing to is not all lowercase - - - name: Extract metadata from Git - id: meta - uses: docker/metadata-action@v4 - with: - images: ${{ env.REGISTRY }}/${{ env.REPO }} - - - name: Build and push API image - id: build-api-image - uses: docker/build-push-action@v4 - with: - platforms: linux/amd64 - context: . - file: ./docker/Dockerfile - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - push: false - # TODO: add a git tag and associated docker tag for it on merge diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000000..e615f5ace7 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,81 @@ +name: PR Validation + +on: + pull_request: + branches: ["main"] + types: [opened, synchronize] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + # Don't want the tests running in parallel + cancel-in-progress: true + +jobs: + app-build-and-test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11"] + + steps: + - uses: szenius/set-timezone@v2.0 + with: + timezoneLinux: "Europe/Amsterdam" + + - name: Set TAG + run: echo "TAG=$(date +%Y%m%d).${{ github.run_number }}.dev" >> $GITHUB_ENV + + - uses: actions/checkout@v4 + + - uses: gerlero/apt-install@v1 + with: + packages: build-essential git libcurl4-openssl-dev curl libssl-dev + install-recommends: false + + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - uses: BSFishy/pip-action@v1 + with: + requirements: requirements_for_test.txt + + - uses: astral-sh/ruff-action@v2 + + - uses: jpetrucciani/black-check@master + + # TODO: fix automated tests + # Connection from runner to test database is needed for tests to run + # or somehow sending a custom job to k8s that would run the tests and report back + - uses: pavelzw/pytest-action@v2 + with: + verbose: false + job-summary: true + custom-arguments: "-n auto --max-fail=10" + continue-on-error: true + + docker-build-and-push: + runs-on: ubuntu-latest + needs: app-build-and-test + + steps: + - uses: actions/checkout@v4 + + - name: Generate version.py before building image + run: | + echo -e "__git_commit__ = \"${{ github.sha }}\"\n__time__ = \"$(date)\"\n__version__ = \"${{ env.TAG }}\"" > ./app/version.py + + - uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - uses: docker/setup-qemu-action@v3 + + - uses: docker/setup-buildx-action@v3 + + - uses: docker/build-push-action@v6 + with: + file: docker/Dockerfile + push: true + tags: worthnl/notifynl-api:${{ env.TAG }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 27d44ab88c..0000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Test - -on: - pull_request: - branches: ["main"] - push: - branches: ["main"] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - - container: - image: python:3.9-slim-bullseye - env: - DEBIAN_FRONTEND: noninteractive - PYTHONUNBUFFEREDf: 1 - - steps: - - uses: actions/checkout@v3 - - - name: Base dependencies - run: | - apt-get update -q - apt-get install -q -y --no-install-recommends build-essential git libcurl4-openssl-dev curl libssl-dev - apt-get -y clean -q - rm -Rf /var/lib/apt/lists/* /tmp/* - - - name: Python dependencies - run: pip install -r requirements_for_test.txt -q - - - name: Ruff - run: ruff check . - - - name: Black - run: black --check . - - - name: Test - run: pytest -n auto --maxfail=10 - continue-on-error: true - # TODO: figure out how to get automated tests working (needs full environment running) From e908c84f36380a1abe607d8f0ffd7011ec2b2954 Mon Sep 17 00:00:00 2001 From: Pier-Angelo Gaetani Date: Mon, 9 Dec 2024 11:43:11 +0100 Subject: [PATCH 02/28] ruff complaints --- app/dao/date_util.py | 2 +- tests/app/clients/test_cbc_proxy.py | 2 +- tests/app/clients/test_document_download.py | 4 ++-- tests/conftest.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/dao/date_util.py b/app/dao/date_util.py index 3fd1d3a27f..4a180e08ca 100644 --- a/app/dao/date_util.py +++ b/app/dao/date_util.py @@ -70,7 +70,7 @@ def get_current_financial_year_start_year(): def get_financial_year_for_datetime(start_date): - if type(start_date) == date: + if type(start_date) is date: start_date = datetime.combine(start_date, time.min) year = int(start_date.strftime("%Y")) diff --git a/tests/app/clients/test_cbc_proxy.py b/tests/app/clients/test_cbc_proxy.py index 40aa811e24..d302a1fc37 100644 --- a/tests/app/clients/test_cbc_proxy.py +++ b/tests/app/clients/test_cbc_proxy.py @@ -73,7 +73,7 @@ def test_cbc_proxy_client_returns_correct_client(provider_name, expected_provide ret = cbc_proxy_client.get_proxy(provider_name) - assert type(ret) == expected_provider_class + assert type(ret) is expected_provider_class assert ret._lambda_client == mock_lambda diff --git a/tests/app/clients/test_document_download.py b/tests/app/clients/test_document_download.py index 96e00683c4..c96237f1c3 100644 --- a/tests/app/clients/test_document_download.py +++ b/tests/app/clients/test_document_download.py @@ -135,7 +135,7 @@ def test_should_raise_non_400_statuses_as_exceptions(document_download, mock_onw document_download.upload_document("service-id", "abababab") - assert type(excinfo.value) == Exception # make sure it's a base exception, so will be handled as a 500 by v2 api + assert type(excinfo.value) is Exception # make sure it's a base exception, so will be handled as a 500 by v2 api assert str(excinfo.value) == 'Unhandled document download error: {"error": "Auth Error Of Some Kind"}' @@ -150,5 +150,5 @@ def test_should_raise_exceptions_without_http_response_bodies_as_exceptions( document_download.upload_document("service-id", "abababab") - assert type(excinfo.value) == Exception # make sure it's a base exception, so will be handled as a 500 by v2 api + assert type(excinfo.value) is Exception # make sure it's a base exception, so will be handled as a 500 by v2 api assert str(excinfo.value) == "Unhandled document download error: ConnectTimeout()" diff --git a/tests/conftest.py b/tests/conftest.py index 1cd205b457..097e863cdb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -43,7 +43,7 @@ def notify_api(): error_handlers[None] = { exc_class: error_handler for exc_class, error_handler in error_handlers[None].items() - if exc_class != Exception + if exc_class is not Exception } if error_handlers[None] == []: error_handlers.pop(None) From 508027c1ecb794a9fdae738a9bb6a9b585a2b057 Mon Sep 17 00:00:00 2001 From: Pier-Angelo Gaetani Date: Mon, 9 Dec 2024 11:53:04 +0100 Subject: [PATCH 03/28] black update and formatting --- .pre-commit-config.yaml | 2 +- app/history_meta.py | 1 + app/service/rest.py | 12 +++++++----- app/upload/rest.py | 8 +++++--- migrations/versions/0066_add_dvla_provider.py | 1 + .../versions/0087_scheduled_notifications.py | 1 + migrations/versions/0091_letter_billing.py | 1 + migrations/versions/0094_job_stats_update.py | 1 + .../versions/0098_service_inbound_api.py | 1 + .../versions/0109_rem_old_noti_status.py | 1 + .../versions/0112_add_start_end_dates.py | 1 + .../versions/0114_drop_monthly_billing_cols.py | 1 + migrations/versions/0119_add_email_reply_to.py | 1 + .../versions/0120_add_org_banner_branding.py | 1 + migrations/versions/0121_nullable_logos.py | 1 + .../0122_add_service_letter_contact.py | 1 + .../versions/0123_add_noti_to_email_reply.py | 1 + .../0124_add_free_sms_fragment_limit.py | 1 + .../versions/0125_add_organisation_type.py | 1 + migrations/versions/0126_add_annual_billing.py | 1 + .../versions/0127_remove_unique_constraint.py | 1 + migrations/versions/0128_noti_to_sms_sender.py | 1 + .../0129_add_email_auth_permission_.py | 1 + migrations/versions/0131_user_auth_types.py | 1 + .../versions/0132_add_sms_prefix_setting.py | 1 + .../versions/0134_add_email_2fa_template_.py | 1 + .../versions/0135_stats_template_usage.py | 1 + .../versions/0136_user_mobile_nullable.py | 1 + .../0137_notification_template_hist.py | 1 + .../versions/0138_sms_sender_nullable.py | 1 + .../0139_migrate_sms_allowance_data.py | 1 + .../versions/0140_sms_prefix_non_nullable.py | 1 + migrations/versions/0141_remove_unused.py | 1 + .../versions/0142_validate_constraints.py | 1 + migrations/versions/0143_remove_reply_to.py | 1 + .../versions/0144_template_service_letter.py | 1 + .../versions/0145_add_notification_reply_to.py | 1 + .../versions/0146_add_service_callback_api.py | 1 + .../versions/0147_drop_mapping_tables.py | 1 + .../versions/0149_add_crown_to_services.py | 1 + .../versions/0151_refactor_letter_rates.py | 1 + .../0152_kill_service_free_fragments.py | 1 + .../0153_add_is_letter_contact_blank.py | 1 + migrations/versions/0154_nullable_is_blank.py | 1 + migrations/versions/0155_revert_0153.py | 1 + .../versions/0156_set_temp_letter_contact.py | 1 + .../versions/0157_add_rate_limit_to_service.py | 1 + .../versions/0158_remove_rate_limit_default.py | 1 + migrations/versions/0161_email_branding.py | 1 + migrations/versions/0162_remove_org.py | 1 + migrations/versions/0163_add_new_org_model.py | 1 + .../0164_add_organisation_to_service.py | 1 + migrations/versions/0166_add_org_user_stuff.py | 1 + migrations/versions/0168_hidden_templates.py | 1 + .../versions/0169_hidden_templates_nullable.py | 1 + .../versions/0170_hidden_non_nullable.py | 1 + .../versions/0171_add_org_invite_template.py | 1 + .../versions/0172_deprioritise_examples.py | 1 + .../0173_create_daily_sorted_letter.py | 1 + migrations/versions/0174_add_billing_facts.py | 1 + .../versions/0175_drop_job_statistics_table.py | 1 + .../versions/0176_alter_billing_columns.py | 1 + .../versions/0177_add_virus_scan_statuses.py | 1 + migrations/versions/0178_add_filename.py | 1 + .../versions/0179_billing_primary_const.py | 1 + .../versions/0181_billing_primary_key.py | 1 + migrations/versions/0183_alter_primary_key.py | 1 + .../versions/0184_alter_primary_key_1.py | 1 + .../0185_add_is_active_to_reply_tos.py | 1 + .../versions/0186_rename_is_active_columns.py | 1 + .../0188_add_ft_notification_status.py | 1 + .../versions/0189_ft_billing_data_type.py | 1 + migrations/versions/0191_ft_billing_pkey.py | 1 + .../versions/0192_drop_provider_statistics.py | 1 + .../versions/0193_add_ft_billing_timestamps.py | 1 + .../versions/0194_ft_billing_created_at.py | 1 + .../0195_ft_notification_timestamps.py | 1 + migrations/versions/0196_complaints_table_.py | 1 + .../versions/0197_service_contact_link.py | 1 + .../versions/0204_service_data_retention.py | 1 + .../versions/0205_service_callback_type.py | 1 + .../versions/0206_assign_callback_type.py | 1 + .../versions/0207_set_callback_history_type.py | 1 + migrations/versions/0208_fix_unique_index.py | 1 + .../versions/0209_add_cancelled_status.py | 1 + .../versions/0210_remove_monthly_billing.py | 1 + .../versions/0211_email_branding_update_.py | 1 + migrations/versions/0212_remove_caseworking.py | 1 + .../versions/0213_brand_colour_domain_.py | 1 + migrations/versions/0215_email_brand_type.py | 1 + migrations/versions/0216_remove_colours.py | 1 + .../versions/0217_default_email_branding.py | 1 + .../versions/0219_default_email_branding.py | 1 + .../versions/0220_email_brand_type_non_null.py | 1 + .../versions/0221_nullable_service_branding.py | 1 + .../versions/0222_drop_service_branding.py | 1 + .../versions/0223_add_domain_constraint.py | 1 + .../versions/0224_returned_letter_status.py | 1 + migrations/versions/0226_service_postage.py | 1 + .../versions/0227_postage_constraints.py | 1 + .../versions/0228_notification_postage.py | 1 + .../versions/0230_noti_postage_constraint_1.py | 1 + .../versions/0231_noti_postage_constraint_2.py | 1 + .../versions/0232_noti_postage_constraint_3.py | 1 + migrations/versions/0234_ft_billing_postage.py | 1 + migrations/versions/0235_add_postage_to_pk.py | 1 + .../versions/0237_add_filename_to_dvla_org.py | 1 + .../versions/0238_add_validation_failed.py | 1 + .../0239_add_edit_folder_permission.py | 1 + .../versions/0240_dvla_org_non_nullable.py | 1 + migrations/versions/0242_template_folders.py | 1 + migrations/versions/0245_archived_flag_jobs.py | 1 + .../versions/0246_notifications_index.py | 1 + .../versions/0248_enable_choose_postage.py | 1 + .../versions/0250_drop_stats_template_table.py | 1 + .../versions/0253_set_template_postage_.py | 1 + migrations/versions/0254_folders_for_all.py | 1 + .../versions/0256_set_postage_tmplt_hstr.py | 1 + .../versions/0258_service_postage_nullable.py | 1 + .../versions/0259_remove_service_postage.py | 1 + .../versions/0260_remove_dvla_organisation.py | 1 + migrations/versions/0261_service_volumes.py | 1 + .../versions/0262_remove_edit_folders.py | 1 + .../versions/0263_remove_edit_folders_2.py | 1 + .../0264_add_folder_permissions_perm.py | 1 + .../0265_add_confirm_edit_templates.py | 1 + .../versions/0266_user_folder_perms_table.py | 1 + .../versions/0277_consent_to_research_null.py | 1 + .../versions/0278_add_more_stuff_to_orgs.py | 1 + migrations/versions/0279_remove_fk_to_users.py | 1 + .../versions/0280_invited_user_folder_perms.py | 1 + .../0281_non_null_folder_permissions.py | 1 + .../versions/0286_add_unique_email_name.py | 1 + .../versions/0287_drop_branding_domains.py | 1 + migrations/versions/0288_add_go_live_user.py | 1 + .../versions/0289_precompiled_for_all.py | 1 + migrations/versions/0290_org_go_live_notes.py | 1 + .../versions/0291_remove_unused_index.py | 1 + .../versions/0292_give_users_folder_perms.py | 1 + migrations/versions/0293_drop_complaint_fk.py | 1 + .../versions/0294_add_verify_reply_to_.py | 1 + migrations/versions/0295_api_key_constraint.py | 1 + .../0296_agreement_signed_by_person.py | 1 + .../versions/0297_template_redacted_fix.py | 1 + .../versions/0298_add_mou_signed_receipt.py | 1 + migrations/versions/0299_org_types_table.py | 1 + .../versions/0301_upload_letters_permission.py | 1 + .../versions/0302_add_org_id_to_services.py | 1 + .../versions/0303_populate_services_org_id.py | 1 + .../versions/0304_remove_org_to_service.py | 1 + .../versions/0306_letter_rates_price_rise.py | 1 + migrations/versions/0307_delete_dm_datetime.py | 1 + .../0308_delete_loadtesting_provider.py | 1 + .../versions/0309_add_uq_key_row_number.py | 1 + .../versions/0310_returned_letters_table_.py | 1 + .../versions/0311_add_inbound_sms_history.py | 1 + .../versions/0312_populate_returned_letters.py | 1 + .../versions/0313_email_access_validated_at.py | 1 + .../versions/0314_populate_email_access.py | 1 + .../versions/0315_document_download_count.py | 1 + .../versions/0316_int_letters_permission.py | 1 + migrations/versions/0317_uploads_for_all.py | 1 + .../versions/0318_service_contact_list.py | 1 + .../versions/0319_contact_list_archived.py | 1 + .../versions/0320_optimise_notifications.py | 1 + .../versions/0321_drop_postage_constraints.py | 1 + .../versions/0322_broadcast_service_perm.py | 1 + migrations/versions/0323_broadcast_message.py | 1 + migrations/versions/0324_int_letter_rates.py | 1 + .../versions/0325_int_letter_rates_fix.py | 1 + migrations/versions/0326_broadcast_event.py | 1 + .../versions/0327_idx_notification_history.py | 1 + .../0328_international_letters_perm.py | 1 + .../versions/0329_purge_broadcast_data.py | 1 + migrations/versions/0331_add_broadcast_org.py | 1 + .../versions/0332_broadcast_provider_msg.py | 1 + .../0333_service_broadcast_provider.py | 1 + .../versions/0334_broadcast_message_number.py | 1 + .../versions/0335_broadcast_msg_content.py | 1 + .../versions/0336_broadcast_msg_content_2.py | 1 + migrations/versions/0337_broadcast_msg_api.py | 1 + .../versions/0338_add_notes_to_service.py | 1 + .../versions/0339_service_billing_details.py | 1 + .../versions/0340_stub_training_broadcasts.py | 1 + migrations/versions/0341_new_letter_rates.py | 1 + .../0342_service_broadcast_settings.py | 1 + .../versions/0343_org_billing_details.py | 1 + .../versions/0344_stubbed_not_nullable.py | 1 + .../versions/0345_move_broadcast_provider.py | 1 + .../versions/0346_notify_number_sms_sender.py | 1 + .../versions/0347_add_dvla_volumes_template.py | 1 + ...cast_settings_migrate_broadcast_settings.py | 1 + .../versions/0349_add_ft_processing_time.py | 1 + migrations/versions/0350_update_rates.py | 1 + .../versions/0351_unique_key_annual_billing.py | 1 + .../versions/0352_broadcast_provider_types.py | 1 + .../0353_broadcast_provider_not_null.py | 1 + migrations/versions/0354_government_channel.py | 1 + migrations/versions/0355_add_webauthn_table.py | 1 + .../versions/0356_add_webautn_auth_type.py | 1 + .../versions/0357_validate_constraint.py | 1 + migrations/versions/0358_operator_channel.py | 1 + migrations/versions/0359_more_permissions.py | 1 + .../0360_remove_sched_notifications_.py | 1 + .../0361_new_user_bcast_permissions.py | 1 + .../versions/0362_broadcast_msg_event.py | 1 + .../versions/0363_cancelled_by_api_key.py | 1 + migrations/versions/0364_drop_old_column.py | 1 + migrations/versions/0365_add_nhs_branding.py | 1 + migrations/versions/0366_letter_rates_2022.py | 1 + migrations/versions/0367_add_reach.py | 1 + .../0368_move_orgs_to_nhs_branding_.py | 1 + migrations/versions/0369_update_sms_rates.py | 1 + migrations/versions/0370_remove_reach.py | 1 + .../versions/0371_fix_apr_2022_sms_rate.py | 1 + .../versions/0374_email_branding_to_org.py | 1 + .../versions/0375_doc_download_verify_email.py | 1 + .../versions/0376_email_branding_pools.py | 1 + .../versions/0377_populate_org_brand_pools.py | 1 + .../versions/0378_remove_doc_download_perm.py | 1 + .../versions/0379_update_archived_users.py | 1 + .../versions/0380_email_branding_cols_.py | 1 + .../versions/0381_letter_branding_to_org.py | 1 + .../versions/0382_nhs_letter_branding_id.py | 1 + .../0383_webauthn_cred_logged_in_at.py | 1 + .../versions/0384_add_nhs_to_letter_pools.py | 1 + .../versions/0385_letter_branding_pools.py | 1 + .../versions/0386_email_branding_alt_text.py | 1 + migrations/versions/0387_migrate_alt_text.py | 1 + .../versions/0388_populate_letter_branding.py | 1 + migrations/versions/0389_split_rate_limits.py | 1 + .../versions/0390_require_rate_limit_value.py | 1 + .../versions/0391_add_go_live_columns.py | 1 + .../versions/0392_go_live_cols_non_nullable.py | 1 + .../versions/0393_add_go_live_template.py | 1 + .../versions/0394_letter_branding_cols.py | 1 + .../versions/0395_migrate_rate_limits.py | 1 + .../0396_make_research_mode_nullable.py | 1 + migrations/versions/0397_drop_research_mode.py | 1 + .../versions/0398_active_email_branding.py | 1 + .../versions/0399_nullable_message_limit.py | 1 + migrations/versions/0400_non_nullable_ids.py | 1 + .../versions/0401_prefix_sms_non_null.py | 1 + .../versions/0402_inbound_sms_history.py | 1 + .../versions/0403_letter_rates_jan_2023.py | 1 + .../versions/0404_remove_message_limit.py | 1 + .../versions/0405_template_formatting_flags.py | 1 + .../versions/0406_1_april_2023_sms_rates.py | 1 + migrations/versions/0407_letter_attachments.py | 1 + .../versions/0408_perm_ask_to_join_service.py | 1 + migrations/versions/0409_annual_allowance.py | 1 + .../versions/0410_drop_unused_allowance.py | 1 + migrations/versions/0411_contact_list_idx.py | 1 + migrations/versions/0412_letter_despatch.py | 1 + .../0413_ft_billing_letter_despatch.py | 1 + .../versions/0414_org_user_permissions.py | 1 + migrations/versions/0415_org_invite_perms.py | 1 + migrations/versions/0416_add_org_user_perms.py | 1 + .../versions/0417_remove_null_constraint.py | 1 + .../versions/0418_readd_null_constraint.py | 1 + .../versions/0419_take_part_in_research.py | 1 + .../versions/0422_unique_service_name_1.py | 1 + .../versions/0423_bilingual_templates.py | 1 + .../0424_letter_languages_constraint.py | 1 + migrations/versions/0425_notify_user_name.py | 1 + .../versions/0426_n_history_created_at.py | 1 + .../versions/0427_unique_service_name_2.py | 1 + migrations/versions/0428_drop_email_from.py | 1 + .../0431_add_new_email_sender_fields.py | 1 + migrations/versions/0432_go_live_templates.py | 1 + .../versions/0433_migrate_email_local_part.py | 1 + .../versions/0434_s_add_not_null_check.py | 1 + .../versions/0435_sh_add_not_null_check.py | 1 + .../versions/0436_validate_not_null_check.py | 1 + .../versions/0437_s_swap_check_for_not_null.py | 1 + .../0438_sh_swap_check_for_not_null.py | 1 + .../versions/0440_request_invite_templates.py | 1 + .../versions/0441_intl_letters_jan_24.py | 1 + requirements_for_test.txt | 2 +- .../app/celery/test_service_callback_tasks.py | 6 +++--- .../notifications/test_post_notifications.py | 18 ++++++++++++------ 281 files changed, 304 insertions(+), 19 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 995b890468..3bfaf3bea9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: - id: ruff args: [--fix, --exit-non-zero-on-fix] - repo: https://github.com/psf/black - rev: 23.10.1 + rev: 24.10.0 hooks: - id: black name: black (python) diff --git a/app/history_meta.py b/app/history_meta.py index 4c268b471b..f483cd4afc 100644 --- a/app/history_meta.py +++ b/app/history_meta.py @@ -14,6 +14,7 @@ session events. """ + import datetime from sqlalchemy import Column, Integer, Table, util diff --git a/app/service/rest.py b/app/service/rest.py index 161a5a7cf5..a870673f89 100644 --- a/app/service/rest.py +++ b/app/service/rest.py @@ -482,11 +482,13 @@ def get_all_notifications_for_service(service_id): jsonify( notifications=notifications, page_size=page_size, - links=get_prev_next_pagination_links( - page, len(next_page_of_pagination.items), ".get_all_notifications_for_service", **kwargs - ) - if count_pages - else {}, + links=( + get_prev_next_pagination_links( + page, len(next_page_of_pagination.items), ".get_all_notifications_for_service", **kwargs + ) + if count_pages + else {} + ), ), 200, ) diff --git a/app/upload/rest.py b/app/upload/rest.py index 021d8ca2a7..3e56103f2d 100644 --- a/app/upload/rest.py +++ b/app/upload/rest.py @@ -39,9 +39,11 @@ def get_paginated_uploads(service_id, limit_days, page): "id": upload.id, "original_file_name": upload.original_file_name, "notification_count": upload.notification_count, - "created_at": upload.scheduled_for.strftime("%Y-%m-%d %H:%M:%S") - if upload.scheduled_for - else upload.created_at.strftime("%Y-%m-%d %H:%M:%S"), + "created_at": ( + upload.scheduled_for.strftime("%Y-%m-%d %H:%M:%S") + if upload.scheduled_for + else upload.created_at.strftime("%Y-%m-%d %H:%M:%S") + ), "upload_type": upload.upload_type, "template_type": upload.template_type, "recipient": upload.recipient, diff --git a/migrations/versions/0066_add_dvla_provider.py b/migrations/versions/0066_add_dvla_provider.py index 48ee79bed1..bb1e05aea5 100644 --- a/migrations/versions/0066_add_dvla_provider.py +++ b/migrations/versions/0066_add_dvla_provider.py @@ -5,6 +5,7 @@ Create Date: 2017-03-02 10:32:28.984947 """ + import uuid from datetime import datetime diff --git a/migrations/versions/0087_scheduled_notifications.py b/migrations/versions/0087_scheduled_notifications.py index 1576f8212e..657cfe9d82 100644 --- a/migrations/versions/0087_scheduled_notifications.py +++ b/migrations/versions/0087_scheduled_notifications.py @@ -5,6 +5,7 @@ Create Date: 2017-05-15 12:50:20.041950 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0091_letter_billing.py b/migrations/versions/0091_letter_billing.py index 38e6cd743b..636aeba5d7 100644 --- a/migrations/versions/0091_letter_billing.py +++ b/migrations/versions/0091_letter_billing.py @@ -5,6 +5,7 @@ Create Date: 2017-05-31 11:43:55.744631 """ + import uuid import sqlalchemy as sa diff --git a/migrations/versions/0094_job_stats_update.py b/migrations/versions/0094_job_stats_update.py index 6299fbff50..12af768e35 100644 --- a/migrations/versions/0094_job_stats_update.py +++ b/migrations/versions/0094_job_stats_update.py @@ -5,6 +5,7 @@ Create Date: 2017-06-06 14:37:30.051647 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0098_service_inbound_api.py b/migrations/versions/0098_service_inbound_api.py index 6d370b860f..d7f5acd889 100644 --- a/migrations/versions/0098_service_inbound_api.py +++ b/migrations/versions/0098_service_inbound_api.py @@ -5,6 +5,7 @@ Create Date: 2017-06-13 15:02:33.609656 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0109_rem_old_noti_status.py b/migrations/versions/0109_rem_old_noti_status.py index ef29a4ec8d..2d10ef8eb8 100644 --- a/migrations/versions/0109_rem_old_noti_status.py +++ b/migrations/versions/0109_rem_old_noti_status.py @@ -5,6 +5,7 @@ Create Date: 2017-07-10 14:25:15.712055 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0112_add_start_end_dates.py b/migrations/versions/0112_add_start_end_dates.py index 8ae738c88a..8cdd6c9e49 100644 --- a/migrations/versions/0112_add_start_end_dates.py +++ b/migrations/versions/0112_add_start_end_dates.py @@ -5,6 +5,7 @@ Create Date: 2017-07-12 13:35:45.636618 """ + from datetime import datetime import sqlalchemy as sa diff --git a/migrations/versions/0114_drop_monthly_billing_cols.py b/migrations/versions/0114_drop_monthly_billing_cols.py index e5244b5e12..7b61bd006a 100644 --- a/migrations/versions/0114_drop_monthly_billing_cols.py +++ b/migrations/versions/0114_drop_monthly_billing_cols.py @@ -5,6 +5,7 @@ Create Date: 2017-07-27 13:36:37.304344 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0119_add_email_reply_to.py b/migrations/versions/0119_add_email_reply_to.py index 81e690133a..c30262ffdd 100644 --- a/migrations/versions/0119_add_email_reply_to.py +++ b/migrations/versions/0119_add_email_reply_to.py @@ -5,6 +5,7 @@ Create Date: 2017-09-07 15:29:49.087143 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0120_add_org_banner_branding.py b/migrations/versions/0120_add_org_banner_branding.py index b7db6ae961..c6613f11ac 100644 --- a/migrations/versions/0120_add_org_banner_branding.py +++ b/migrations/versions/0120_add_org_banner_branding.py @@ -5,6 +5,7 @@ Create Date: 2017-09-18 14:18:49.087143 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0121_nullable_logos.py b/migrations/versions/0121_nullable_logos.py index 53148d6f8a..a2dcd1d8d3 100644 --- a/migrations/versions/0121_nullable_logos.py +++ b/migrations/versions/0121_nullable_logos.py @@ -5,6 +5,7 @@ Create Date: 2017-09-20 11:00:20.415523 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0122_add_service_letter_contact.py b/migrations/versions/0122_add_service_letter_contact.py index c31818c7cd..e86db92027 100644 --- a/migrations/versions/0122_add_service_letter_contact.py +++ b/migrations/versions/0122_add_service_letter_contact.py @@ -5,6 +5,7 @@ Create Date: 2017-09-21 12:16:02.975120 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0123_add_noti_to_email_reply.py b/migrations/versions/0123_add_noti_to_email_reply.py index 7fbeef1495..f727f3bc2f 100644 --- a/migrations/versions/0123_add_noti_to_email_reply.py +++ b/migrations/versions/0123_add_noti_to_email_reply.py @@ -5,6 +5,7 @@ Create Date: 2017-09-27 09:42:39.412731 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0124_add_free_sms_fragment_limit.py b/migrations/versions/0124_add_free_sms_fragment_limit.py index fe1a338238..f64eca155b 100644 --- a/migrations/versions/0124_add_free_sms_fragment_limit.py +++ b/migrations/versions/0124_add_free_sms_fragment_limit.py @@ -5,6 +5,7 @@ Create Date: 2017-10-10 11:30:16.225980 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0125_add_organisation_type.py b/migrations/versions/0125_add_organisation_type.py index d7cb47b645..2076b5a292 100644 --- a/migrations/versions/0125_add_organisation_type.py +++ b/migrations/versions/0125_add_organisation_type.py @@ -5,6 +5,7 @@ Create Date: 2017-10-05 14:03:00.248005 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0126_add_annual_billing.py b/migrations/versions/0126_add_annual_billing.py index d674eac147..4bcc1cb66b 100644 --- a/migrations/versions/0126_add_annual_billing.py +++ b/migrations/versions/0126_add_annual_billing.py @@ -5,6 +5,7 @@ Create Date: 2017-10-19 11:38:32.849573 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0127_remove_unique_constraint.py b/migrations/versions/0127_remove_unique_constraint.py index 01385b9aa1..b75e10688a 100644 --- a/migrations/versions/0127_remove_unique_constraint.py +++ b/migrations/versions/0127_remove_unique_constraint.py @@ -5,6 +5,7 @@ Create Date: 2017-10-17 16:47:37.826333 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0128_noti_to_sms_sender.py b/migrations/versions/0128_noti_to_sms_sender.py index 289d673808..55c94a70c7 100644 --- a/migrations/versions/0128_noti_to_sms_sender.py +++ b/migrations/versions/0128_noti_to_sms_sender.py @@ -5,6 +5,7 @@ Create Date: 2017-10-26 15:17:00.752706 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0129_add_email_auth_permission_.py b/migrations/versions/0129_add_email_auth_permission_.py index 927121d268..e4e8694b49 100644 --- a/migrations/versions/0129_add_email_auth_permission_.py +++ b/migrations/versions/0129_add_email_auth_permission_.py @@ -5,6 +5,7 @@ Create Date: 2017-10-26 14:33:41.336861 """ + from alembic import op revision = "0129_add_email_auth_permission" diff --git a/migrations/versions/0131_user_auth_types.py b/migrations/versions/0131_user_auth_types.py index aaa0a9e0dd..56d4147d76 100644 --- a/migrations/versions/0131_user_auth_types.py +++ b/migrations/versions/0131_user_auth_types.py @@ -5,6 +5,7 @@ Create Date: 2017-10-27 16:19:51.458863 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0132_add_sms_prefix_setting.py b/migrations/versions/0132_add_sms_prefix_setting.py index 5d4745ee5d..336902c409 100644 --- a/migrations/versions/0132_add_sms_prefix_setting.py +++ b/migrations/versions/0132_add_sms_prefix_setting.py @@ -5,6 +5,7 @@ Create Date: 2017-11-03 11:07:40.537006 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0134_add_email_2fa_template_.py b/migrations/versions/0134_add_email_2fa_template_.py index 8f6b71b230..5702486e02 100644 --- a/migrations/versions/0134_add_email_2fa_template_.py +++ b/migrations/versions/0134_add_email_2fa_template_.py @@ -5,6 +5,7 @@ Create Date: 2017-11-03 13:52:59.715203 """ + from datetime import datetime from alembic import op diff --git a/migrations/versions/0135_stats_template_usage.py b/migrations/versions/0135_stats_template_usage.py index 373e9a7053..376ec7dc48 100644 --- a/migrations/versions/0135_stats_template_usage.py +++ b/migrations/versions/0135_stats_template_usage.py @@ -5,6 +5,7 @@ Create Date: 2017-11-07 14:35:04.798561 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0136_user_mobile_nullable.py b/migrations/versions/0136_user_mobile_nullable.py index c222535376..50a4b6a9e3 100644 --- a/migrations/versions/0136_user_mobile_nullable.py +++ b/migrations/versions/0136_user_mobile_nullable.py @@ -5,6 +5,7 @@ Create Date: 2017-11-08 11:49:05.773974 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0137_notification_template_hist.py b/migrations/versions/0137_notification_template_hist.py index 67891eb2db..cb8efc1cbe 100644 --- a/migrations/versions/0137_notification_template_hist.py +++ b/migrations/versions/0137_notification_template_hist.py @@ -5,6 +5,7 @@ Create Date: 2017-11-08 10:15:07.039227 """ + from alembic import op revision = "0137_notification_template_hist" diff --git a/migrations/versions/0138_sms_sender_nullable.py b/migrations/versions/0138_sms_sender_nullable.py index 1b57a5f28a..3bbf5d14a2 100644 --- a/migrations/versions/0138_sms_sender_nullable.py +++ b/migrations/versions/0138_sms_sender_nullable.py @@ -5,6 +5,7 @@ Create Date: 2017-11-06 15:44:59.471977 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0139_migrate_sms_allowance_data.py b/migrations/versions/0139_migrate_sms_allowance_data.py index 6bae800c6b..9202abf353 100644 --- a/migrations/versions/0139_migrate_sms_allowance_data.py +++ b/migrations/versions/0139_migrate_sms_allowance_data.py @@ -5,6 +5,7 @@ Create Date: 2017-11-10 21:42:59.715203 """ + import uuid from datetime import datetime diff --git a/migrations/versions/0140_sms_prefix_non_nullable.py b/migrations/versions/0140_sms_prefix_non_nullable.py index 899d4ca31c..ee58c2a884 100644 --- a/migrations/versions/0140_sms_prefix_non_nullable.py +++ b/migrations/versions/0140_sms_prefix_non_nullable.py @@ -5,6 +5,7 @@ Create Date: 2017-11-07 13:04:04.077142 """ + import sqlalchemy as sa from alembic import op from flask import current_app diff --git a/migrations/versions/0141_remove_unused.py b/migrations/versions/0141_remove_unused.py index c80e870b9c..0f878a7f32 100644 --- a/migrations/versions/0141_remove_unused.py +++ b/migrations/versions/0141_remove_unused.py @@ -5,6 +5,7 @@ Create Date: 2017-11-20 11:35:24.402021 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0142_validate_constraints.py b/migrations/versions/0142_validate_constraints.py index cc4d430a87..72e42002ea 100644 --- a/migrations/versions/0142_validate_constraints.py +++ b/migrations/versions/0142_validate_constraints.py @@ -5,6 +5,7 @@ Create Date: 2017-11-15 14:39:13.657666 """ + from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0143_remove_reply_to.py b/migrations/versions/0143_remove_reply_to.py index 165ad7fdb8..d3cfba41f2 100644 --- a/migrations/versions/0143_remove_reply_to.py +++ b/migrations/versions/0143_remove_reply_to.py @@ -5,6 +5,7 @@ Create Date: 2017-11-21 10:42:25.045444 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0144_template_service_letter.py b/migrations/versions/0144_template_service_letter.py index 59db0dc93c..7f79917aa6 100644 --- a/migrations/versions/0144_template_service_letter.py +++ b/migrations/versions/0144_template_service_letter.py @@ -5,6 +5,7 @@ Create Date: 2017-11-17 15:42:16.401229 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0145_add_notification_reply_to.py b/migrations/versions/0145_add_notification_reply_to.py index ad0b16d1d8..3cfed383c5 100644 --- a/migrations/versions/0145_add_notification_reply_to.py +++ b/migrations/versions/0145_add_notification_reply_to.py @@ -5,6 +5,7 @@ Create Date: 2017-11-22 14:23:48.806781 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0146_add_service_callback_api.py b/migrations/versions/0146_add_service_callback_api.py index 39f0fb0ae7..ba7b26d718 100644 --- a/migrations/versions/0146_add_service_callback_api.py +++ b/migrations/versions/0146_add_service_callback_api.py @@ -5,6 +5,7 @@ Create Date: 2017-11-28 15:13:48.730554 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0147_drop_mapping_tables.py b/migrations/versions/0147_drop_mapping_tables.py index 0f80920813..eacdf4de96 100644 --- a/migrations/versions/0147_drop_mapping_tables.py +++ b/migrations/versions/0147_drop_mapping_tables.py @@ -5,6 +5,7 @@ Create Date: 2017-11-30 15:48:44.588438 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0149_add_crown_to_services.py b/migrations/versions/0149_add_crown_to_services.py index 106960472c..5c5d4698ff 100644 --- a/migrations/versions/0149_add_crown_to_services.py +++ b/migrations/versions/0149_add_crown_to_services.py @@ -5,6 +5,7 @@ Create Date: 2017-12-04 12:13:35.268712 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0151_refactor_letter_rates.py b/migrations/versions/0151_refactor_letter_rates.py index 56fb94b502..c51caa076c 100644 --- a/migrations/versions/0151_refactor_letter_rates.py +++ b/migrations/versions/0151_refactor_letter_rates.py @@ -5,6 +5,7 @@ Create Date: 2017-12-05 10:24:41.232128 """ + import uuid from datetime import datetime diff --git a/migrations/versions/0152_kill_service_free_fragments.py b/migrations/versions/0152_kill_service_free_fragments.py index e603bb1b86..9ecb20c548 100644 --- a/migrations/versions/0152_kill_service_free_fragments.py +++ b/migrations/versions/0152_kill_service_free_fragments.py @@ -5,6 +5,7 @@ Create Date: 2017-12-01 16:49:51.178455 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0153_add_is_letter_contact_blank.py b/migrations/versions/0153_add_is_letter_contact_blank.py index 09d693c163..27999396a1 100644 --- a/migrations/versions/0153_add_is_letter_contact_blank.py +++ b/migrations/versions/0153_add_is_letter_contact_blank.py @@ -5,6 +5,7 @@ Create Date: 2018-01-04 10:27:01.014640 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0154_nullable_is_blank.py b/migrations/versions/0154_nullable_is_blank.py index 0349559186..caee31d3de 100644 --- a/migrations/versions/0154_nullable_is_blank.py +++ b/migrations/versions/0154_nullable_is_blank.py @@ -5,6 +5,7 @@ Create Date: 2018-01-05 15:49:36.522210 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0155_revert_0153.py b/migrations/versions/0155_revert_0153.py index d5a87d412a..20c86ce1b0 100644 --- a/migrations/versions/0155_revert_0153.py +++ b/migrations/versions/0155_revert_0153.py @@ -5,6 +5,7 @@ Create Date: 2018-01-05 14:09:21.200102 """ + from alembic import op revision = "0155_revert_0153" diff --git a/migrations/versions/0156_set_temp_letter_contact.py b/migrations/versions/0156_set_temp_letter_contact.py index b8459bb698..a6df26d061 100644 --- a/migrations/versions/0156_set_temp_letter_contact.py +++ b/migrations/versions/0156_set_temp_letter_contact.py @@ -5,6 +5,7 @@ Create Date: 2018-01-05 17:04:20.596271 """ + from alembic import op revision = "0156_set_temp_letter_contact" diff --git a/migrations/versions/0157_add_rate_limit_to_service.py b/migrations/versions/0157_add_rate_limit_to_service.py index a8a504f3ef..b9b110b856 100644 --- a/migrations/versions/0157_add_rate_limit_to_service.py +++ b/migrations/versions/0157_add_rate_limit_to_service.py @@ -5,6 +5,7 @@ Create Date: 2018-01-08 16:13:25.733336 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0158_remove_rate_limit_default.py b/migrations/versions/0158_remove_rate_limit_default.py index 6adeb529cf..bc22a245f2 100644 --- a/migrations/versions/0158_remove_rate_limit_default.py +++ b/migrations/versions/0158_remove_rate_limit_default.py @@ -5,6 +5,7 @@ Create Date: 2018-01-09 14:33:08.313893 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0161_email_branding.py b/migrations/versions/0161_email_branding.py index 94630ffd83..5867015705 100644 --- a/migrations/versions/0161_email_branding.py +++ b/migrations/versions/0161_email_branding.py @@ -5,6 +5,7 @@ Create Date: 2018-01-30 15:35:12.016574 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0162_remove_org.py b/migrations/versions/0162_remove_org.py index 0a7510bb01..71000ea83e 100644 --- a/migrations/versions/0162_remove_org.py +++ b/migrations/versions/0162_remove_org.py @@ -5,6 +5,7 @@ Create Date: 2018-02-06 17:08:11.879844 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0163_add_new_org_model.py b/migrations/versions/0163_add_new_org_model.py index 7b5cb50e7f..e4443075cf 100644 --- a/migrations/versions/0163_add_new_org_model.py +++ b/migrations/versions/0163_add_new_org_model.py @@ -5,6 +5,7 @@ Create Date: 2018-02-07 14:03:00.804849 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0164_add_organisation_to_service.py b/migrations/versions/0164_add_organisation_to_service.py index 156864a60e..3a236072d8 100644 --- a/migrations/versions/0164_add_organisation_to_service.py +++ b/migrations/versions/0164_add_organisation_to_service.py @@ -5,6 +5,7 @@ Create Date: 2018-02-09 17:58:34.617206 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0166_add_org_user_stuff.py b/migrations/versions/0166_add_org_user_stuff.py index f27dd26953..e9abe82255 100644 --- a/migrations/versions/0166_add_org_user_stuff.py +++ b/migrations/versions/0166_add_org_user_stuff.py @@ -5,6 +5,7 @@ Create Date: 2018-02-14 17:25:11.747996 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0168_hidden_templates.py b/migrations/versions/0168_hidden_templates.py index 0c3efb1eb3..11a9898fe6 100644 --- a/migrations/versions/0168_hidden_templates.py +++ b/migrations/versions/0168_hidden_templates.py @@ -5,6 +5,7 @@ Create Date: 2018-02-21 14:05:04.448977 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0169_hidden_templates_nullable.py b/migrations/versions/0169_hidden_templates_nullable.py index 76bde31c61..72c0ebe035 100644 --- a/migrations/versions/0169_hidden_templates_nullable.py +++ b/migrations/versions/0169_hidden_templates_nullable.py @@ -5,6 +5,7 @@ Create Date: 2018-02-21 14:05:04.448977 """ + from alembic import op revision = "0169_hidden_templates_nullable" diff --git a/migrations/versions/0170_hidden_non_nullable.py b/migrations/versions/0170_hidden_non_nullable.py index 8101bf703a..7d059610d1 100644 --- a/migrations/versions/0170_hidden_non_nullable.py +++ b/migrations/versions/0170_hidden_non_nullable.py @@ -5,6 +5,7 @@ Create Date: 2018-02-21 14:05:04.448977 """ + from alembic import op revision = "0170_hidden_non_nullable" diff --git a/migrations/versions/0171_add_org_invite_template.py b/migrations/versions/0171_add_org_invite_template.py index ab8bdc24ef..7339a25f56 100644 --- a/migrations/versions/0171_add_org_invite_template.py +++ b/migrations/versions/0171_add_org_invite_template.py @@ -5,6 +5,7 @@ Create Date: 2018-02-16 14:16:43.618062 """ + from datetime import datetime from alembic import op diff --git a/migrations/versions/0172_deprioritise_examples.py b/migrations/versions/0172_deprioritise_examples.py index 6d61e4bfd4..9532cd8979 100644 --- a/migrations/versions/0172_deprioritise_examples.py +++ b/migrations/versions/0172_deprioritise_examples.py @@ -5,6 +5,7 @@ Create Date: 2018-02-28 17:09:56.619803 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0173_create_daily_sorted_letter.py b/migrations/versions/0173_create_daily_sorted_letter.py index 070e6176d2..3be3937b54 100644 --- a/migrations/versions/0173_create_daily_sorted_letter.py +++ b/migrations/versions/0173_create_daily_sorted_letter.py @@ -5,6 +5,7 @@ Create Date: 2018-03-01 11:53:32.964256 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0174_add_billing_facts.py b/migrations/versions/0174_add_billing_facts.py index 1f4cc66750..623ae970c9 100644 --- a/migrations/versions/0174_add_billing_facts.py +++ b/migrations/versions/0174_add_billing_facts.py @@ -5,6 +5,7 @@ Create Date: 2018-03-07 12:21:53.098887 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0175_drop_job_statistics_table.py b/migrations/versions/0175_drop_job_statistics_table.py index 52f0ed5aeb..e3c50cd8c3 100644 --- a/migrations/versions/0175_drop_job_statistics_table.py +++ b/migrations/versions/0175_drop_job_statistics_table.py @@ -5,6 +5,7 @@ Create Date: 2018-03-12 10:27:09.050837 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0176_alter_billing_columns.py b/migrations/versions/0176_alter_billing_columns.py index 1e3781dee3..a12faa71d7 100644 --- a/migrations/versions/0176_alter_billing_columns.py +++ b/migrations/versions/0176_alter_billing_columns.py @@ -5,6 +5,7 @@ Create Date: 2018-03-12 16:54:30.663897 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0177_add_virus_scan_statuses.py b/migrations/versions/0177_add_virus_scan_statuses.py index 5ee243bb80..458948e3b0 100644 --- a/migrations/versions/0177_add_virus_scan_statuses.py +++ b/migrations/versions/0177_add_virus_scan_statuses.py @@ -5,6 +5,7 @@ Create Date: 2018-02-21 14:05:04.448977 """ + from alembic import op revision = "0177_add_virus_scan_statuses" diff --git a/migrations/versions/0178_add_filename.py b/migrations/versions/0178_add_filename.py index 32c8f2ade6..bfcd403e3b 100644 --- a/migrations/versions/0178_add_filename.py +++ b/migrations/versions/0178_add_filename.py @@ -5,6 +5,7 @@ Create Date: 2018-03-14 16:15:01.886998 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0179_billing_primary_const.py b/migrations/versions/0179_billing_primary_const.py index fbfb756dbc..dea32fab18 100644 --- a/migrations/versions/0179_billing_primary_const.py +++ b/migrations/versions/0179_billing_primary_const.py @@ -5,6 +5,7 @@ Create Date: 2018-03-13 14:52:40.413474 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0181_billing_primary_key.py b/migrations/versions/0181_billing_primary_key.py index e87e471a52..e4a7553868 100644 --- a/migrations/versions/0181_billing_primary_key.py +++ b/migrations/versions/0181_billing_primary_key.py @@ -5,6 +5,7 @@ Create Date: 2018-03-21 13:41:26.203712 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0183_alter_primary_key.py b/migrations/versions/0183_alter_primary_key.py index bbeec4fc26..bd83204115 100644 --- a/migrations/versions/0183_alter_primary_key.py +++ b/migrations/versions/0183_alter_primary_key.py @@ -5,6 +5,7 @@ Create Date: 2018-03-25 21:23:32.403212 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0184_alter_primary_key_1.py b/migrations/versions/0184_alter_primary_key_1.py index bfdb64d48f..f9f5f0c371 100644 --- a/migrations/versions/0184_alter_primary_key_1.py +++ b/migrations/versions/0184_alter_primary_key_1.py @@ -5,6 +5,7 @@ Create Date: 2018-03-28 16:05:54.648645 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0185_add_is_active_to_reply_tos.py b/migrations/versions/0185_add_is_active_to_reply_tos.py index 34ccfab6cd..13ab2df999 100644 --- a/migrations/versions/0185_add_is_active_to_reply_tos.py +++ b/migrations/versions/0185_add_is_active_to_reply_tos.py @@ -5,6 +5,7 @@ Create Date: 2018-04-10 16:35:41.824981 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0186_rename_is_active_columns.py b/migrations/versions/0186_rename_is_active_columns.py index 81092b92a9..db34c07a3d 100644 --- a/migrations/versions/0186_rename_is_active_columns.py +++ b/migrations/versions/0186_rename_is_active_columns.py @@ -5,6 +5,7 @@ Create Date: 2018-04-27 16:35:41.824981 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0188_add_ft_notification_status.py b/migrations/versions/0188_add_ft_notification_status.py index 08e574d504..fa34aaf4b1 100644 --- a/migrations/versions/0188_add_ft_notification_status.py +++ b/migrations/versions/0188_add_ft_notification_status.py @@ -5,6 +5,7 @@ Create Date: 2018-05-03 10:10:41.824981 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0189_ft_billing_data_type.py b/migrations/versions/0189_ft_billing_data_type.py index 30aadda9d3..166541c4d1 100644 --- a/migrations/versions/0189_ft_billing_data_type.py +++ b/migrations/versions/0189_ft_billing_data_type.py @@ -5,6 +5,7 @@ Create Date: 2018-05-10 14:57:52.589773 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0191_ft_billing_pkey.py b/migrations/versions/0191_ft_billing_pkey.py index 8564093a85..0ad52dcc35 100644 --- a/migrations/versions/0191_ft_billing_pkey.py +++ b/migrations/versions/0191_ft_billing_pkey.py @@ -5,6 +5,7 @@ Create Date: 2018-05-21 14:24:27.229511 """ + from alembic import op revision = "0191_ft_billing_pkey" diff --git a/migrations/versions/0192_drop_provider_statistics.py b/migrations/versions/0192_drop_provider_statistics.py index efc91f2634..0c0798b089 100644 --- a/migrations/versions/0192_drop_provider_statistics.py +++ b/migrations/versions/0192_drop_provider_statistics.py @@ -5,6 +5,7 @@ Create Date: 2018-05-21 15:18:43.871256 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0193_add_ft_billing_timestamps.py b/migrations/versions/0193_add_ft_billing_timestamps.py index c688ed089c..0602cadd5e 100644 --- a/migrations/versions/0193_add_ft_billing_timestamps.py +++ b/migrations/versions/0193_add_ft_billing_timestamps.py @@ -5,6 +5,7 @@ Create Date: 2018-05-22 10:23:21.937262 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0194_ft_billing_created_at.py b/migrations/versions/0194_ft_billing_created_at.py index 8bc4d007f1..3b6f8e6670 100644 --- a/migrations/versions/0194_ft_billing_created_at.py +++ b/migrations/versions/0194_ft_billing_created_at.py @@ -5,6 +5,7 @@ Create Date: 2018-05-22 14:34:27.852096 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0195_ft_notification_timestamps.py b/migrations/versions/0195_ft_notification_timestamps.py index 0453b472c7..256442203b 100644 --- a/migrations/versions/0195_ft_notification_timestamps.py +++ b/migrations/versions/0195_ft_notification_timestamps.py @@ -5,6 +5,7 @@ Create Date: 2018-05-22 16:01:53.269137 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0196_complaints_table_.py b/migrations/versions/0196_complaints_table_.py index e44f0f1c20..5faad895cd 100644 --- a/migrations/versions/0196_complaints_table_.py +++ b/migrations/versions/0196_complaints_table_.py @@ -5,6 +5,7 @@ Create Date: 2018-05-31 14:31:36.649544 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0197_service_contact_link.py b/migrations/versions/0197_service_contact_link.py index 78f8deafec..9557e84d77 100644 --- a/migrations/versions/0197_service_contact_link.py +++ b/migrations/versions/0197_service_contact_link.py @@ -5,6 +5,7 @@ Create Date: 2018-05-31 15:01:32.977620 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0204_service_data_retention.py b/migrations/versions/0204_service_data_retention.py index 6bc451167e..6948051bf3 100644 --- a/migrations/versions/0204_service_data_retention.py +++ b/migrations/versions/0204_service_data_retention.py @@ -5,6 +5,7 @@ Create Date: 2018-07-10 11:22:01.761829 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0205_service_callback_type.py b/migrations/versions/0205_service_callback_type.py index e589e59815..289918013d 100644 --- a/migrations/versions/0205_service_callback_type.py +++ b/migrations/versions/0205_service_callback_type.py @@ -5,6 +5,7 @@ Create Date: 2018-07-17 15:51:10.776698 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0206_assign_callback_type.py b/migrations/versions/0206_assign_callback_type.py index 39367cb7ee..e843db9391 100644 --- a/migrations/versions/0206_assign_callback_type.py +++ b/migrations/versions/0206_assign_callback_type.py @@ -5,6 +5,7 @@ Create Date: 2018-07-18 10:43:43.864835 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0207_set_callback_history_type.py b/migrations/versions/0207_set_callback_history_type.py index 9c4d998af7..9b4455ae27 100644 --- a/migrations/versions/0207_set_callback_history_type.py +++ b/migrations/versions/0207_set_callback_history_type.py @@ -5,6 +5,7 @@ Create Date: 2018-07-18 10:43:43.864835 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0208_fix_unique_index.py b/migrations/versions/0208_fix_unique_index.py index 0ad53f814d..9a04a11c3f 100644 --- a/migrations/versions/0208_fix_unique_index.py +++ b/migrations/versions/0208_fix_unique_index.py @@ -5,6 +5,7 @@ Create Date: 2018-07-25 13:55:24.941794 """ + from alembic import op revision = "84c3b6eb16b3" diff --git a/migrations/versions/0209_add_cancelled_status.py b/migrations/versions/0209_add_cancelled_status.py index 5f560ca352..ee17605ea6 100644 --- a/migrations/versions/0209_add_cancelled_status.py +++ b/migrations/versions/0209_add_cancelled_status.py @@ -5,6 +5,7 @@ Create Date: 2018-07-31 13:34:00.018447 """ + from alembic import op revision = "0209_add_cancelled_status" diff --git a/migrations/versions/0210_remove_monthly_billing.py b/migrations/versions/0210_remove_monthly_billing.py index f5c5c31df3..7d09ee6e7c 100644 --- a/migrations/versions/0210_remove_monthly_billing.py +++ b/migrations/versions/0210_remove_monthly_billing.py @@ -5,6 +5,7 @@ Create Date: 2018-07-31 16:43:00.568972 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0211_email_branding_update_.py b/migrations/versions/0211_email_branding_update_.py index 47a8c2c4a2..f9e693cce6 100644 --- a/migrations/versions/0211_email_branding_update_.py +++ b/migrations/versions/0211_email_branding_update_.py @@ -5,6 +5,7 @@ Create Date: 2018-07-31 18:00:20.457755 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0212_remove_caseworking.py b/migrations/versions/0212_remove_caseworking.py index 41e2bce35a..d6cf53799b 100644 --- a/migrations/versions/0212_remove_caseworking.py +++ b/migrations/versions/0212_remove_caseworking.py @@ -5,6 +5,7 @@ Create Date: 2018-07-31 18:00:20.457755 """ + from alembic import op revision = "0212_remove_caseworking" diff --git a/migrations/versions/0213_brand_colour_domain_.py b/migrations/versions/0213_brand_colour_domain_.py index 7ad313b6a3..c6b1535908 100644 --- a/migrations/versions/0213_brand_colour_domain_.py +++ b/migrations/versions/0213_brand_colour_domain_.py @@ -5,6 +5,7 @@ Create Date: 2018-08-16 16:29:41.374944 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0215_email_brand_type.py b/migrations/versions/0215_email_brand_type.py index 0853a499d1..1a21ccee01 100644 --- a/migrations/versions/0215_email_brand_type.py +++ b/migrations/versions/0215_email_brand_type.py @@ -5,6 +5,7 @@ Create Date: 2018-08-23 11:48:00.800968 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0216_remove_colours.py b/migrations/versions/0216_remove_colours.py index 82311feb7e..4dc33fd6ae 100644 --- a/migrations/versions/0216_remove_colours.py +++ b/migrations/versions/0216_remove_colours.py @@ -3,6 +3,7 @@ Revises: 0215_email_brand_type Create Date: 2018-08-24 13:36:49.346156 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0217_default_email_branding.py b/migrations/versions/0217_default_email_branding.py index 1d3a3151eb..217bc66fa8 100644 --- a/migrations/versions/0217_default_email_branding.py +++ b/migrations/versions/0217_default_email_branding.py @@ -3,6 +3,7 @@ Revises: 0216_remove_colours Create Date: 2018-08-24 13:36:49.346156 """ + from alembic import op from app.models import BRANDING_ORG diff --git a/migrations/versions/0219_default_email_branding.py b/migrations/versions/0219_default_email_branding.py index ae09404567..a21876ab2f 100644 --- a/migrations/versions/0219_default_email_branding.py +++ b/migrations/versions/0219_default_email_branding.py @@ -3,6 +3,7 @@ Revises: 0218_another_letter_org Create Date: 2018-08-24 13:36:49.346156 """ + from alembic import op from app.models import BRANDING_ORG diff --git a/migrations/versions/0220_email_brand_type_non_null.py b/migrations/versions/0220_email_brand_type_non_null.py index f1c48f07b3..3d7b9d2395 100644 --- a/migrations/versions/0220_email_brand_type_non_null.py +++ b/migrations/versions/0220_email_brand_type_non_null.py @@ -3,6 +3,7 @@ Revises: 0219_default_email_branding Create Date: 2018-08-24 13:36:49.346156 """ + from alembic import op revision = "0220_email_brand_type_non_null" diff --git a/migrations/versions/0221_nullable_service_branding.py b/migrations/versions/0221_nullable_service_branding.py index c0bf007b16..b364d71162 100644 --- a/migrations/versions/0221_nullable_service_branding.py +++ b/migrations/versions/0221_nullable_service_branding.py @@ -3,6 +3,7 @@ Revises: 0220_email_brand_type_non_null Create Date: 2018-08-24 13:36:49.346156 """ + from alembic import op from app.constants import BRANDING_GOVUK, BRANDING_ORG diff --git a/migrations/versions/0222_drop_service_branding.py b/migrations/versions/0222_drop_service_branding.py index ae08e2c0b5..6197768fae 100644 --- a/migrations/versions/0222_drop_service_branding.py +++ b/migrations/versions/0222_drop_service_branding.py @@ -3,6 +3,7 @@ Revises: 0221_nullable_service_branding Create Date: 2018-08-24 13:36:49.346156 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0223_add_domain_constraint.py b/migrations/versions/0223_add_domain_constraint.py index 783c3fd653..1824b482ff 100644 --- a/migrations/versions/0223_add_domain_constraint.py +++ b/migrations/versions/0223_add_domain_constraint.py @@ -3,6 +3,7 @@ Revises: 0222_drop_service_branding Create Date: 2018-08-24 13:36:49.346156 """ + from alembic import op revision = "0223_add_domain_constraint" diff --git a/migrations/versions/0224_returned_letter_status.py b/migrations/versions/0224_returned_letter_status.py index a817f0d0a6..ff2e0b854f 100644 --- a/migrations/versions/0224_returned_letter_status.py +++ b/migrations/versions/0224_returned_letter_status.py @@ -5,6 +5,7 @@ Create Date: 2018-08-21 14:44:04.203480 """ + from alembic import op revision = "0224_returned_letter_status" diff --git a/migrations/versions/0226_service_postage.py b/migrations/versions/0226_service_postage.py index 59f914348d..652eaa5249 100644 --- a/migrations/versions/0226_service_postage.py +++ b/migrations/versions/0226_service_postage.py @@ -5,6 +5,7 @@ Create Date: 2018-09-13 16:23:59.168877 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0227_postage_constraints.py b/migrations/versions/0227_postage_constraints.py index 7852e27b9d..b05e18ae6f 100644 --- a/migrations/versions/0227_postage_constraints.py +++ b/migrations/versions/0227_postage_constraints.py @@ -3,6 +3,7 @@ Revises: 0226_service_postage Create Date: 2018-09-13 16:23:59.168877 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0228_notification_postage.py b/migrations/versions/0228_notification_postage.py index 554c0f2da0..bf3ef5785b 100644 --- a/migrations/versions/0228_notification_postage.py +++ b/migrations/versions/0228_notification_postage.py @@ -5,6 +5,7 @@ Create Date: 2018-09-19 11:42:52.229430 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0230_noti_postage_constraint_1.py b/migrations/versions/0230_noti_postage_constraint_1.py index cf04e54cfd..45c257781c 100644 --- a/migrations/versions/0230_noti_postage_constraint_1.py +++ b/migrations/versions/0230_noti_postage_constraint_1.py @@ -5,6 +5,7 @@ Create Date: 2018-09-19 11:42:52.229430 """ + from alembic import op revision = "0230_noti_postage_constraint_1" diff --git a/migrations/versions/0231_noti_postage_constraint_2.py b/migrations/versions/0231_noti_postage_constraint_2.py index 2bf223561a..d7dbb53aa2 100644 --- a/migrations/versions/0231_noti_postage_constraint_2.py +++ b/migrations/versions/0231_noti_postage_constraint_2.py @@ -5,6 +5,7 @@ Create Date: 2018-09-19 11:42:52.229430 """ + from alembic import op revision = "0230_noti_postage_constraint_2" diff --git a/migrations/versions/0232_noti_postage_constraint_3.py b/migrations/versions/0232_noti_postage_constraint_3.py index 9ae30c4e14..d078be6ee3 100644 --- a/migrations/versions/0232_noti_postage_constraint_3.py +++ b/migrations/versions/0232_noti_postage_constraint_3.py @@ -5,6 +5,7 @@ Create Date: 2018-09-19 11:42:52.229430 """ + from alembic import op revision = "0230_noti_postage_constraint_3" diff --git a/migrations/versions/0234_ft_billing_postage.py b/migrations/versions/0234_ft_billing_postage.py index 447c39a046..d35c415ae0 100644 --- a/migrations/versions/0234_ft_billing_postage.py +++ b/migrations/versions/0234_ft_billing_postage.py @@ -5,6 +5,7 @@ Create Date: 2018-09-28 14:43:26.100884 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0235_add_postage_to_pk.py b/migrations/versions/0235_add_postage_to_pk.py index fac3ef0f61..f4ed44ee30 100644 --- a/migrations/versions/0235_add_postage_to_pk.py +++ b/migrations/versions/0235_add_postage_to_pk.py @@ -5,6 +5,7 @@ Create Date: 2018-09-28 15:39:21.115358 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0237_add_filename_to_dvla_org.py b/migrations/versions/0237_add_filename_to_dvla_org.py index 3086b04077..38c04939b6 100644 --- a/migrations/versions/0237_add_filename_to_dvla_org.py +++ b/migrations/versions/0237_add_filename_to_dvla_org.py @@ -5,6 +5,7 @@ Create Date: 2018-09-28 15:39:21.115358 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.sql import text diff --git a/migrations/versions/0238_add_validation_failed.py b/migrations/versions/0238_add_validation_failed.py index b580dee9ac..358590fb85 100644 --- a/migrations/versions/0238_add_validation_failed.py +++ b/migrations/versions/0238_add_validation_failed.py @@ -5,6 +5,7 @@ Create Date: 2018-09-03 11:24:58.773824 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0239_add_edit_folder_permission.py b/migrations/versions/0239_add_edit_folder_permission.py index b7bad01c7a..b084219b5a 100644 --- a/migrations/versions/0239_add_edit_folder_permission.py +++ b/migrations/versions/0239_add_edit_folder_permission.py @@ -5,6 +5,7 @@ Create Date: 2018-09-03 11:24:58.773824 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0240_dvla_org_non_nullable.py b/migrations/versions/0240_dvla_org_non_nullable.py index b59ee5c3ee..bb6c6ff515 100644 --- a/migrations/versions/0240_dvla_org_non_nullable.py +++ b/migrations/versions/0240_dvla_org_non_nullable.py @@ -5,6 +5,7 @@ Create Date: 2018-10-25 09:16:54.602182 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0242_template_folders.py b/migrations/versions/0242_template_folders.py index 1ee53f8eef..0b7a0d3475 100644 --- a/migrations/versions/0242_template_folders.py +++ b/migrations/versions/0242_template_folders.py @@ -5,6 +5,7 @@ Create Date: 2018-10-26 16:00:40.173840 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0245_archived_flag_jobs.py b/migrations/versions/0245_archived_flag_jobs.py index 34bfbdb6eb..70c9c9c188 100644 --- a/migrations/versions/0245_archived_flag_jobs.py +++ b/migrations/versions/0245_archived_flag_jobs.py @@ -5,6 +5,7 @@ Create Date: 2018-11-22 16:32:01.105803 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0246_notifications_index.py b/migrations/versions/0246_notifications_index.py index b6670fb1e9..8a889d9f78 100644 --- a/migrations/versions/0246_notifications_index.py +++ b/migrations/versions/0246_notifications_index.py @@ -5,6 +5,7 @@ Create Date: 2018-12-12 12:00:09.770775 """ + from alembic import op revision = "0246_notifications_index" diff --git a/migrations/versions/0248_enable_choose_postage.py b/migrations/versions/0248_enable_choose_postage.py index 56f9fa5235..e373999ec1 100644 --- a/migrations/versions/0248_enable_choose_postage.py +++ b/migrations/versions/0248_enable_choose_postage.py @@ -5,6 +5,7 @@ Create Date: 2018-12-14 12:09:31.375634 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0250_drop_stats_template_table.py b/migrations/versions/0250_drop_stats_template_table.py index 839bd4abfc..9ccfc36d7d 100644 --- a/migrations/versions/0250_drop_stats_template_table.py +++ b/migrations/versions/0250_drop_stats_template_table.py @@ -5,6 +5,7 @@ Create Date: 2019-01-15 16:47:08.049369 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0253_set_template_postage_.py b/migrations/versions/0253_set_template_postage_.py index 8b1ed05967..1b014615d4 100644 --- a/migrations/versions/0253_set_template_postage_.py +++ b/migrations/versions/0253_set_template_postage_.py @@ -5,6 +5,7 @@ Create Date: 2019-01-30 16:47:08.599448 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0254_folders_for_all.py b/migrations/versions/0254_folders_for_all.py index 419901a567..5b6220d875 100644 --- a/migrations/versions/0254_folders_for_all.py +++ b/migrations/versions/0254_folders_for_all.py @@ -5,6 +5,7 @@ Create Date: 2019-01-08 13:30:48.694881+00 """ + from alembic import op revision = "0254_folders_for_all" diff --git a/migrations/versions/0256_set_postage_tmplt_hstr.py b/migrations/versions/0256_set_postage_tmplt_hstr.py index a294a6a50a..440edb98bc 100644 --- a/migrations/versions/0256_set_postage_tmplt_hstr.py +++ b/migrations/versions/0256_set_postage_tmplt_hstr.py @@ -5,6 +5,7 @@ Create Date: 2019-02-05 14:51:30.808067 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0258_service_postage_nullable.py b/migrations/versions/0258_service_postage_nullable.py index 711a6f90de..5c950fc696 100644 --- a/migrations/versions/0258_service_postage_nullable.py +++ b/migrations/versions/0258_service_postage_nullable.py @@ -5,6 +5,7 @@ Create Date: 2019-02-12 11:52:53.139383 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0259_remove_service_postage.py b/migrations/versions/0259_remove_service_postage.py index 4d0c92078a..d8a921ab08 100644 --- a/migrations/versions/0259_remove_service_postage.py +++ b/migrations/versions/0259_remove_service_postage.py @@ -5,6 +5,7 @@ Create Date: 2019-02-11 17:12:22.341599 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0260_remove_dvla_organisation.py b/migrations/versions/0260_remove_dvla_organisation.py index df00f38f2f..a7612a999f 100644 --- a/migrations/versions/0260_remove_dvla_organisation.py +++ b/migrations/versions/0260_remove_dvla_organisation.py @@ -5,6 +5,7 @@ Create Date: 2019-02-12 17:39:02.517571 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0261_service_volumes.py b/migrations/versions/0261_service_volumes.py index 4274cca68d..ea603fdb9e 100644 --- a/migrations/versions/0261_service_volumes.py +++ b/migrations/versions/0261_service_volumes.py @@ -5,6 +5,7 @@ Create Date: 2019-02-13 13:45:00.782500 """ + from itertools import product import sqlalchemy as sa diff --git a/migrations/versions/0262_remove_edit_folders.py b/migrations/versions/0262_remove_edit_folders.py index 40a56b620e..20d9615d9e 100644 --- a/migrations/versions/0262_remove_edit_folders.py +++ b/migrations/versions/0262_remove_edit_folders.py @@ -5,6 +5,7 @@ Create Date: 2019-02-15 11:20:25.812823 """ + from alembic import op revision = "0262_remove_edit_folders" diff --git a/migrations/versions/0263_remove_edit_folders_2.py b/migrations/versions/0263_remove_edit_folders_2.py index 1b26b9cb3c..d499d4f4c8 100644 --- a/migrations/versions/0263_remove_edit_folders_2.py +++ b/migrations/versions/0263_remove_edit_folders_2.py @@ -5,6 +5,7 @@ Create Date: 2019-02-15 14:38:13.823432 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0264_add_folder_permissions_perm.py b/migrations/versions/0264_add_folder_permissions_perm.py index 2255c0e6f9..315179e55e 100644 --- a/migrations/versions/0264_add_folder_permissions_perm.py +++ b/migrations/versions/0264_add_folder_permissions_perm.py @@ -5,6 +5,7 @@ Create Date: 2019-02-14 11:23:26.694656 """ + from alembic import op revision = "0264_add_folder_permissions_perm" diff --git a/migrations/versions/0265_add_confirm_edit_templates.py b/migrations/versions/0265_add_confirm_edit_templates.py index 2158a4a1eb..bae99d99f5 100644 --- a/migrations/versions/0265_add_confirm_edit_templates.py +++ b/migrations/versions/0265_add_confirm_edit_templates.py @@ -5,6 +5,7 @@ Create Date: 2019-02-26 15:16:53.268135 """ + from datetime import datetime from alembic import op diff --git a/migrations/versions/0266_user_folder_perms_table.py b/migrations/versions/0266_user_folder_perms_table.py index b11241a02e..caf4d2b8de 100644 --- a/migrations/versions/0266_user_folder_perms_table.py +++ b/migrations/versions/0266_user_folder_perms_table.py @@ -5,6 +5,7 @@ Create Date: 2019-02-26 17:00:13.247321 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0277_consent_to_research_null.py b/migrations/versions/0277_consent_to_research_null.py index 3054d5000a..7d41c85306 100644 --- a/migrations/versions/0277_consent_to_research_null.py +++ b/migrations/versions/0277_consent_to_research_null.py @@ -5,6 +5,7 @@ Create Date: 2019-03-01 13:47:15.720238 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0278_add_more_stuff_to_orgs.py b/migrations/versions/0278_add_more_stuff_to_orgs.py index 794c40fae8..463623ec7a 100644 --- a/migrations/versions/0278_add_more_stuff_to_orgs.py +++ b/migrations/versions/0278_add_more_stuff_to_orgs.py @@ -5,6 +5,7 @@ Create Date: 2019-02-26 10:15:22.430340 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0279_remove_fk_to_users.py b/migrations/versions/0279_remove_fk_to_users.py index 83345f4e22..4b338bd6b6 100644 --- a/migrations/versions/0279_remove_fk_to_users.py +++ b/migrations/versions/0279_remove_fk_to_users.py @@ -5,6 +5,7 @@ Create Date: 2019-03-06 16:49:28.674498 """ + from alembic import op revision = "0279_remove_fk_to_users" diff --git a/migrations/versions/0280_invited_user_folder_perms.py b/migrations/versions/0280_invited_user_folder_perms.py index 7d3eeda3b9..83e0239770 100644 --- a/migrations/versions/0280_invited_user_folder_perms.py +++ b/migrations/versions/0280_invited_user_folder_perms.py @@ -5,6 +5,7 @@ Create Date: 2019-03-11 14:38:28.010082 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0281_non_null_folder_permissions.py b/migrations/versions/0281_non_null_folder_permissions.py index 72cfe9f2d9..dfd219156d 100644 --- a/migrations/versions/0281_non_null_folder_permissions.py +++ b/migrations/versions/0281_non_null_folder_permissions.py @@ -5,6 +5,7 @@ Create Date: 2019-03-20 10:12:24.927129 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0286_add_unique_email_name.py b/migrations/versions/0286_add_unique_email_name.py index ba2b5027bd..7b7547b271 100644 --- a/migrations/versions/0286_add_unique_email_name.py +++ b/migrations/versions/0286_add_unique_email_name.py @@ -5,6 +5,7 @@ Create Date: 2019-04-09 13:01:13.892249 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0287_drop_branding_domains.py b/migrations/versions/0287_drop_branding_domains.py index 3167d4b18d..816201b52d 100644 --- a/migrations/versions/0287_drop_branding_domains.py +++ b/migrations/versions/0287_drop_branding_domains.py @@ -5,6 +5,7 @@ Create Date: 2019-04-05 16:25:11.535816 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0288_add_go_live_user.py b/migrations/versions/0288_add_go_live_user.py index 2635010f5a..a76a58760f 100644 --- a/migrations/versions/0288_add_go_live_user.py +++ b/migrations/versions/0288_add_go_live_user.py @@ -5,6 +5,7 @@ Create Date: 2019-04-15 16:50:22.275673 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0289_precompiled_for_all.py b/migrations/versions/0289_precompiled_for_all.py index 6470997b68..71f8892f85 100644 --- a/migrations/versions/0289_precompiled_for_all.py +++ b/migrations/versions/0289_precompiled_for_all.py @@ -5,6 +5,7 @@ Create Date: 2019-05-13 10:44:51.867661 """ + from alembic import op revision = "0289_precompiled_for_all" diff --git a/migrations/versions/0290_org_go_live_notes.py b/migrations/versions/0290_org_go_live_notes.py index 39c5f50b0c..471b09fe30 100644 --- a/migrations/versions/0290_org_go_live_notes.py +++ b/migrations/versions/0290_org_go_live_notes.py @@ -5,6 +5,7 @@ Create Date: 2019-05-13 14:55:10.291781 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0291_remove_unused_index.py b/migrations/versions/0291_remove_unused_index.py index b31c01898f..8c9facccd9 100644 --- a/migrations/versions/0291_remove_unused_index.py +++ b/migrations/versions/0291_remove_unused_index.py @@ -5,6 +5,7 @@ Create Date: 2019-05-16 14:05:18.104274 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0292_give_users_folder_perms.py b/migrations/versions/0292_give_users_folder_perms.py index 5533554fe6..90c5f8456a 100644 --- a/migrations/versions/0292_give_users_folder_perms.py +++ b/migrations/versions/0292_give_users_folder_perms.py @@ -5,6 +5,7 @@ Create Date: 2019-04-01 16:36:53.274394 """ + from alembic import op from sqlalchemy.sql import text diff --git a/migrations/versions/0293_drop_complaint_fk.py b/migrations/versions/0293_drop_complaint_fk.py index 0a448375c2..469ec18708 100644 --- a/migrations/versions/0293_drop_complaint_fk.py +++ b/migrations/versions/0293_drop_complaint_fk.py @@ -5,6 +5,7 @@ Create Date: 2019-05-16 14:05:18.104274 """ + from alembic import op revision = "0293_drop_complaint_fk" diff --git a/migrations/versions/0294_add_verify_reply_to_.py b/migrations/versions/0294_add_verify_reply_to_.py index b639dffd90..b480f92289 100644 --- a/migrations/versions/0294_add_verify_reply_to_.py +++ b/migrations/versions/0294_add_verify_reply_to_.py @@ -5,6 +5,7 @@ Create Date: 2019-05-22 16:58:52.929661 """ + from datetime import datetime from alembic import op diff --git a/migrations/versions/0295_api_key_constraint.py b/migrations/versions/0295_api_key_constraint.py index 44941d35d3..1dd679aada 100644 --- a/migrations/versions/0295_api_key_constraint.py +++ b/migrations/versions/0295_api_key_constraint.py @@ -5,6 +5,7 @@ Create Date: 2019-06-04 13:49:50.685493 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0296_agreement_signed_by_person.py b/migrations/versions/0296_agreement_signed_by_person.py index e00f186d8e..dd63b11603 100644 --- a/migrations/versions/0296_agreement_signed_by_person.py +++ b/migrations/versions/0296_agreement_signed_by_person.py @@ -5,6 +5,7 @@ Create Date: 2019-06-13 16:40:32.982607 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0297_template_redacted_fix.py b/migrations/versions/0297_template_redacted_fix.py index ef4cbe38a2..c65a8a15aa 100644 --- a/migrations/versions/0297_template_redacted_fix.py +++ b/migrations/versions/0297_template_redacted_fix.py @@ -5,6 +5,7 @@ Create Date: 2019-06-25 17:02:14.350064 """ + from alembic import op revision = "0297_template_redacted_fix" diff --git a/migrations/versions/0298_add_mou_signed_receipt.py b/migrations/versions/0298_add_mou_signed_receipt.py index d9a1d945f8..85bc8440df 100644 --- a/migrations/versions/0298_add_mou_signed_receipt.py +++ b/migrations/versions/0298_add_mou_signed_receipt.py @@ -5,6 +5,7 @@ Create Date: 2019-05-22 16:58:52.929661 """ + from alembic import op from flask import current_app diff --git a/migrations/versions/0299_org_types_table.py b/migrations/versions/0299_org_types_table.py index e25fb1c9dd..1eaa3576fa 100644 --- a/migrations/versions/0299_org_types_table.py +++ b/migrations/versions/0299_org_types_table.py @@ -5,6 +5,7 @@ Create Date: 2019-07-10 16:07:22.019759 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0301_upload_letters_permission.py b/migrations/versions/0301_upload_letters_permission.py index b41cb1fa4e..3ae1ae5200 100644 --- a/migrations/versions/0301_upload_letters_permission.py +++ b/migrations/versions/0301_upload_letters_permission.py @@ -5,6 +5,7 @@ Create Date: 2019-08-05 10:49:27.467361 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0302_add_org_id_to_services.py b/migrations/versions/0302_add_org_id_to_services.py index 3fd390d2e2..94c106e4ae 100644 --- a/migrations/versions/0302_add_org_id_to_services.py +++ b/migrations/versions/0302_add_org_id_to_services.py @@ -5,6 +5,7 @@ Create Date: 2019-08-06 09:43:57.993510 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0303_populate_services_org_id.py b/migrations/versions/0303_populate_services_org_id.py index ad24f1a498..523a1a8062 100644 --- a/migrations/versions/0303_populate_services_org_id.py +++ b/migrations/versions/0303_populate_services_org_id.py @@ -5,6 +5,7 @@ Create Date: 2019-08-06 09:43:57.993510 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.sql import text diff --git a/migrations/versions/0304_remove_org_to_service.py b/migrations/versions/0304_remove_org_to_service.py index aed4ce2425..bebecc6ca4 100644 --- a/migrations/versions/0304_remove_org_to_service.py +++ b/migrations/versions/0304_remove_org_to_service.py @@ -5,6 +5,7 @@ Create Date: 2019-08-15 14:49:00.754390 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0306_letter_rates_price_rise.py b/migrations/versions/0306_letter_rates_price_rise.py index 6d8752043f..16019d7d03 100644 --- a/migrations/versions/0306_letter_rates_price_rise.py +++ b/migrations/versions/0306_letter_rates_price_rise.py @@ -19,6 +19,7 @@ Create Date: 2019-09-25 15:43:09.388251 """ + import itertools import uuid from datetime import datetime diff --git a/migrations/versions/0307_delete_dm_datetime.py b/migrations/versions/0307_delete_dm_datetime.py index e38f75d7ae..91e1786719 100644 --- a/migrations/versions/0307_delete_dm_datetime.py +++ b/migrations/versions/0307_delete_dm_datetime.py @@ -5,6 +5,7 @@ Create Date: 2019-10-08 10:57:54.824807 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0308_delete_loadtesting_provider.py b/migrations/versions/0308_delete_loadtesting_provider.py index 586cb7b81a..7a9d901d28 100644 --- a/migrations/versions/0308_delete_loadtesting_provider.py +++ b/migrations/versions/0308_delete_loadtesting_provider.py @@ -6,6 +6,7 @@ Create Date: 2019-10-22 17:30 """ + import uuid from alembic import op diff --git a/migrations/versions/0309_add_uq_key_row_number.py b/migrations/versions/0309_add_uq_key_row_number.py index 89706431a4..0f2a792371 100644 --- a/migrations/versions/0309_add_uq_key_row_number.py +++ b/migrations/versions/0309_add_uq_key_row_number.py @@ -5,6 +5,7 @@ Create Date: 2019-11-05 10:12:03.627850 """ + from alembic import op revision = "0309_add_uq_key_row_number" diff --git a/migrations/versions/0310_returned_letters_table_.py b/migrations/versions/0310_returned_letters_table_.py index 74b8433bf7..83bbff1195 100644 --- a/migrations/versions/0310_returned_letters_table_.py +++ b/migrations/versions/0310_returned_letters_table_.py @@ -5,6 +5,7 @@ Create Date: 2019-12-09 12:13:49.432993 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0311_add_inbound_sms_history.py b/migrations/versions/0311_add_inbound_sms_history.py index 40b3014d2a..be013b31ce 100644 --- a/migrations/versions/0311_add_inbound_sms_history.py +++ b/migrations/versions/0311_add_inbound_sms_history.py @@ -5,6 +5,7 @@ Create Date: 2019-12-20 15:38:53.358509 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0312_populate_returned_letters.py b/migrations/versions/0312_populate_returned_letters.py index f0a44ce025..9fa5dd0c75 100644 --- a/migrations/versions/0312_populate_returned_letters.py +++ b/migrations/versions/0312_populate_returned_letters.py @@ -5,6 +5,7 @@ Create Date: 2019-12-09 12:13:49.432993 """ + from alembic import op revision = "0312_populate_returned_letters" diff --git a/migrations/versions/0313_email_access_validated_at.py b/migrations/versions/0313_email_access_validated_at.py index 5174c4fef6..2b1fcebb2f 100644 --- a/migrations/versions/0313_email_access_validated_at.py +++ b/migrations/versions/0313_email_access_validated_at.py @@ -5,6 +5,7 @@ Create Date: 2020-01-28 18:03:22.237386 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0314_populate_email_access.py b/migrations/versions/0314_populate_email_access.py index 8a50d6979f..972bdbf54a 100644 --- a/migrations/versions/0314_populate_email_access.py +++ b/migrations/versions/0314_populate_email_access.py @@ -5,6 +5,7 @@ Create Date: 2020-01-31 10:35:44.524606 """ + from alembic import op revision = "0314_populate_email_access" diff --git a/migrations/versions/0315_document_download_count.py b/migrations/versions/0315_document_download_count.py index 6834371cde..1f59df9db6 100644 --- a/migrations/versions/0315_document_download_count.py +++ b/migrations/versions/0315_document_download_count.py @@ -5,6 +5,7 @@ Create Date: 2020-02-12 14:19:18.066425 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0316_int_letters_permission.py b/migrations/versions/0316_int_letters_permission.py index d3bb47d803..70d1a86ef9 100644 --- a/migrations/versions/0316_int_letters_permission.py +++ b/migrations/versions/0316_int_letters_permission.py @@ -5,6 +5,7 @@ Create Date: 2020-09-13 28:17:17.110495 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0317_uploads_for_all.py b/migrations/versions/0317_uploads_for_all.py index 4f71348c25..1ef33a8d2e 100644 --- a/migrations/versions/0317_uploads_for_all.py +++ b/migrations/versions/0317_uploads_for_all.py @@ -5,6 +5,7 @@ Create Date: 2019-05-13 10:44:51.867661 """ + from alembic import op from app.constants import UPLOAD_LETTERS diff --git a/migrations/versions/0318_service_contact_list.py b/migrations/versions/0318_service_contact_list.py index 1fc86499e9..6bd9fa1bfe 100644 --- a/migrations/versions/0318_service_contact_list.py +++ b/migrations/versions/0318_service_contact_list.py @@ -5,6 +5,7 @@ Create Date: 2020-03-12 15:44:30.784031 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0319_contact_list_archived.py b/migrations/versions/0319_contact_list_archived.py index f803406417..822ad7daf0 100644 --- a/migrations/versions/0319_contact_list_archived.py +++ b/migrations/versions/0319_contact_list_archived.py @@ -5,6 +5,7 @@ Create Date: 2020-03-26 11:16:12.389524 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0320_optimise_notifications.py b/migrations/versions/0320_optimise_notifications.py index b893ccef9b..4414d121b5 100644 --- a/migrations/versions/0320_optimise_notifications.py +++ b/migrations/versions/0320_optimise_notifications.py @@ -5,6 +5,7 @@ Create Date: 2020-03-26 11:16:12.389524 """ + import os from alembic import op diff --git a/migrations/versions/0321_drop_postage_constraints.py b/migrations/versions/0321_drop_postage_constraints.py index ef235ad64e..f90c33118d 100644 --- a/migrations/versions/0321_drop_postage_constraints.py +++ b/migrations/versions/0321_drop_postage_constraints.py @@ -5,6 +5,7 @@ Create Date: 2020-06-08 11:48:53.315768 """ + import os from alembic import op diff --git a/migrations/versions/0322_broadcast_service_perm.py b/migrations/versions/0322_broadcast_service_perm.py index 21997bc3e4..838fb5130f 100644 --- a/migrations/versions/0322_broadcast_service_perm.py +++ b/migrations/versions/0322_broadcast_service_perm.py @@ -5,6 +5,7 @@ Create Date: 2020-06-29 11:14:13.183683 """ + from alembic import op revision = "0322_broadcast_service_perm" diff --git a/migrations/versions/0323_broadcast_message.py b/migrations/versions/0323_broadcast_message.py index 84c0c84876..3707914e12 100644 --- a/migrations/versions/0323_broadcast_message.py +++ b/migrations/versions/0323_broadcast_message.py @@ -5,6 +5,7 @@ Create Date: 2020-07-02 11:59:38.734650 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0324_int_letter_rates.py b/migrations/versions/0324_int_letter_rates.py index 051af6daec..dc9d8403c8 100644 --- a/migrations/versions/0324_int_letter_rates.py +++ b/migrations/versions/0324_int_letter_rates.py @@ -5,6 +5,7 @@ Create Date: 2020-07-08 12:20:20.700128 """ + import itertools import uuid from datetime import datetime diff --git a/migrations/versions/0325_int_letter_rates_fix.py b/migrations/versions/0325_int_letter_rates_fix.py index 27b9a72ce8..787f5d4e84 100644 --- a/migrations/versions/0325_int_letter_rates_fix.py +++ b/migrations/versions/0325_int_letter_rates_fix.py @@ -5,6 +5,7 @@ Create Date: 2020-07-15 10:09:17.218183 """ + from datetime import datetime from alembic import op diff --git a/migrations/versions/0326_broadcast_event.py b/migrations/versions/0326_broadcast_event.py index 0d7e8ff64f..e997ea3cd1 100644 --- a/migrations/versions/0326_broadcast_event.py +++ b/migrations/versions/0326_broadcast_event.py @@ -5,6 +5,7 @@ Create Date: 2020-07-24 12:40:35.809523 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0327_idx_notification_history.py b/migrations/versions/0327_idx_notification_history.py index d4fa2d522b..6c561de3a9 100644 --- a/migrations/versions/0327_idx_notification_history.py +++ b/migrations/versions/0327_idx_notification_history.py @@ -5,6 +5,7 @@ Create Date: 2020-07-28 08:11:07.666708 """ + import os from alembic import op diff --git a/migrations/versions/0328_international_letters_perm.py b/migrations/versions/0328_international_letters_perm.py index 2706b5bf97..1c66e10aec 100644 --- a/migrations/versions/0328_international_letters_perm.py +++ b/migrations/versions/0328_international_letters_perm.py @@ -5,6 +5,7 @@ Create Date: 2020-08-10 14:12:02.870838 """ + from alembic import op from sqlalchemy import text diff --git a/migrations/versions/0329_purge_broadcast_data.py b/migrations/versions/0329_purge_broadcast_data.py index c1df398a16..bfca674531 100644 --- a/migrations/versions/0329_purge_broadcast_data.py +++ b/migrations/versions/0329_purge_broadcast_data.py @@ -5,6 +5,7 @@ Create Date: 2020-09-07 16:00:27.545673 """ + from alembic import op revision = "0329_purge_broadcast_data" diff --git a/migrations/versions/0331_add_broadcast_org.py b/migrations/versions/0331_add_broadcast_org.py index cbcb07c1bf..f92a68afe1 100644 --- a/migrations/versions/0331_add_broadcast_org.py +++ b/migrations/versions/0331_add_broadcast_org.py @@ -5,6 +5,7 @@ Create Date: 2020-09-23 10:11:01.094412 """ + import os import sqlalchemy as sa diff --git a/migrations/versions/0332_broadcast_provider_msg.py b/migrations/versions/0332_broadcast_provider_msg.py index c9c193f847..6ba79d1522 100644 --- a/migrations/versions/0332_broadcast_provider_msg.py +++ b/migrations/versions/0332_broadcast_provider_msg.py @@ -5,6 +5,7 @@ Create Date: 2020-10-26 16:28:11.917468 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0333_service_broadcast_provider.py b/migrations/versions/0333_service_broadcast_provider.py index 26a5a54622..6050327bb2 100644 --- a/migrations/versions/0333_service_broadcast_provider.py +++ b/migrations/versions/0333_service_broadcast_provider.py @@ -5,6 +5,7 @@ Create Date: 2020-12-01 17:03:18.209780 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0334_broadcast_message_number.py b/migrations/versions/0334_broadcast_message_number.py index 8802f8335d..abef49545d 100644 --- a/migrations/versions/0334_broadcast_message_number.py +++ b/migrations/versions/0334_broadcast_message_number.py @@ -5,6 +5,7 @@ Create Date: 2020-12-04 15:06:22.544803 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0335_broadcast_msg_content.py b/migrations/versions/0335_broadcast_msg_content.py index c8506a2354..9470ba7236 100644 --- a/migrations/versions/0335_broadcast_msg_content.py +++ b/migrations/versions/0335_broadcast_msg_content.py @@ -5,6 +5,7 @@ Create Date: 2020-12-04 15:06:22.544803 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0336_broadcast_msg_content_2.py b/migrations/versions/0336_broadcast_msg_content_2.py index a3d6fc26e9..c5dd9dd4d9 100644 --- a/migrations/versions/0336_broadcast_msg_content_2.py +++ b/migrations/versions/0336_broadcast_msg_content_2.py @@ -5,6 +5,7 @@ Create Date: 2020-12-04 15:06:22.544803 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0337_broadcast_msg_api.py b/migrations/versions/0337_broadcast_msg_api.py index d0686ea6a7..9884637472 100644 --- a/migrations/versions/0337_broadcast_msg_api.py +++ b/migrations/versions/0337_broadcast_msg_api.py @@ -5,6 +5,7 @@ Create Date: 2020-12-04 15:06:22.544803 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0338_add_notes_to_service.py b/migrations/versions/0338_add_notes_to_service.py index c2ad3b9129..4ef4cfd923 100644 --- a/migrations/versions/0338_add_notes_to_service.py +++ b/migrations/versions/0338_add_notes_to_service.py @@ -5,6 +5,7 @@ Create Date: 2021-01-13 11:50:06.333369 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0339_service_billing_details.py b/migrations/versions/0339_service_billing_details.py index 703bbe6574..847fa0d671 100644 --- a/migrations/versions/0339_service_billing_details.py +++ b/migrations/versions/0339_service_billing_details.py @@ -5,6 +5,7 @@ Create Date: 2021-01-20 17:55:46.555460 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0340_stub_training_broadcasts.py b/migrations/versions/0340_stub_training_broadcasts.py index b615f7b640..ad9f513edf 100644 --- a/migrations/versions/0340_stub_training_broadcasts.py +++ b/migrations/versions/0340_stub_training_broadcasts.py @@ -5,6 +5,7 @@ Create Date: 2021-01-26 16:48:44.921065 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0341_new_letter_rates.py b/migrations/versions/0341_new_letter_rates.py index 664abe57a7..db3e13ba55 100644 --- a/migrations/versions/0341_new_letter_rates.py +++ b/migrations/versions/0341_new_letter_rates.py @@ -5,6 +5,7 @@ Create Date: 2021-01-27 11:58:21.393227 """ + import itertools import uuid from datetime import datetime diff --git a/migrations/versions/0342_service_broadcast_settings.py b/migrations/versions/0342_service_broadcast_settings.py index 2b88b4f18f..9f1c2bb333 100644 --- a/migrations/versions/0342_service_broadcast_settings.py +++ b/migrations/versions/0342_service_broadcast_settings.py @@ -5,6 +5,7 @@ Create Date: 2021-01-28 21:30:23.102340 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0343_org_billing_details.py b/migrations/versions/0343_org_billing_details.py index 32f6e41b6c..6d44c161aa 100644 --- a/migrations/versions/0343_org_billing_details.py +++ b/migrations/versions/0343_org_billing_details.py @@ -5,6 +5,7 @@ Create Date: 2021-02-01 14:40:14.809632 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0344_stubbed_not_nullable.py b/migrations/versions/0344_stubbed_not_nullable.py index 397a514c0f..7abffb7011 100644 --- a/migrations/versions/0344_stubbed_not_nullable.py +++ b/migrations/versions/0344_stubbed_not_nullable.py @@ -5,6 +5,7 @@ Create Date: 2021-02-08 18:10:15.533279 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0345_move_broadcast_provider.py b/migrations/versions/0345_move_broadcast_provider.py index e8ce8ffa85..cd88d2effb 100644 --- a/migrations/versions/0345_move_broadcast_provider.py +++ b/migrations/versions/0345_move_broadcast_provider.py @@ -5,6 +5,7 @@ Create Date: 2021-02-09 09:19:07.957980 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0346_notify_number_sms_sender.py b/migrations/versions/0346_notify_number_sms_sender.py index e91d3782cd..db64d4f4b8 100644 --- a/migrations/versions/0346_notify_number_sms_sender.py +++ b/migrations/versions/0346_notify_number_sms_sender.py @@ -5,6 +5,7 @@ Create Date: 2021-02-17 10:40:10.181087 """ + import uuid from alembic import op diff --git a/migrations/versions/0347_add_dvla_volumes_template.py b/migrations/versions/0347_add_dvla_volumes_template.py index 8253cd334e..6a00819b5c 100644 --- a/migrations/versions/0347_add_dvla_volumes_template.py +++ b/migrations/versions/0347_add_dvla_volumes_template.py @@ -5,6 +5,7 @@ Create Date: 2021-02-15 15:36:34.654275 """ + import os from datetime import datetime diff --git a/migrations/versions/0348_migrate_broadcast_settings_migrate_broadcast_settings.py b/migrations/versions/0348_migrate_broadcast_settings_migrate_broadcast_settings.py index 70c9967147..6935af5bbb 100644 --- a/migrations/versions/0348_migrate_broadcast_settings_migrate_broadcast_settings.py +++ b/migrations/versions/0348_migrate_broadcast_settings_migrate_broadcast_settings.py @@ -5,6 +5,7 @@ Create Date: 2021-02-18 15:25:30.667098 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0349_add_ft_processing_time.py b/migrations/versions/0349_add_ft_processing_time.py index 6c56bcf490..d0d7e92749 100644 --- a/migrations/versions/0349_add_ft_processing_time.py +++ b/migrations/versions/0349_add_ft_processing_time.py @@ -5,6 +5,7 @@ Create Date: 2021-02-22 14:05:24.775338 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0350_update_rates.py b/migrations/versions/0350_update_rates.py index c090cc5dbe..d0235f0cb0 100644 --- a/migrations/versions/0350_update_rates.py +++ b/migrations/versions/0350_update_rates.py @@ -5,6 +5,7 @@ Create Date: 2021-04-01 08:00:24.775338 """ + import uuid from alembic import op diff --git a/migrations/versions/0351_unique_key_annual_billing.py b/migrations/versions/0351_unique_key_annual_billing.py index bfa7e269bf..7de031d205 100644 --- a/migrations/versions/0351_unique_key_annual_billing.py +++ b/migrations/versions/0351_unique_key_annual_billing.py @@ -5,6 +5,7 @@ Create Date: 2021-04-12 09:02:45.098875 """ + import os from alembic import op diff --git a/migrations/versions/0352_broadcast_provider_types.py b/migrations/versions/0352_broadcast_provider_types.py index 94f5f55a8e..b1fee28d3c 100644 --- a/migrations/versions/0352_broadcast_provider_types.py +++ b/migrations/versions/0352_broadcast_provider_types.py @@ -5,6 +5,7 @@ Create Date: 2021-05-05 15:07:22.146657 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0353_broadcast_provider_not_null.py b/migrations/versions/0353_broadcast_provider_not_null.py index e9ba460d4f..8f5e18c8d9 100644 --- a/migrations/versions/0353_broadcast_provider_not_null.py +++ b/migrations/versions/0353_broadcast_provider_not_null.py @@ -5,6 +5,7 @@ Create Date: 2021-05-10 15:06:40.046786 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0354_government_channel.py b/migrations/versions/0354_government_channel.py index 7e71c8acf0..b83825106d 100644 --- a/migrations/versions/0354_government_channel.py +++ b/migrations/versions/0354_government_channel.py @@ -5,6 +5,7 @@ Create Date: 2021-05-11 16:17:12.479191 """ + from alembic import op revision = "0354_government_channel" diff --git a/migrations/versions/0355_add_webauthn_table.py b/migrations/versions/0355_add_webauthn_table.py index 6263dfe9a0..d6961f1c47 100644 --- a/migrations/versions/0355_add_webauthn_table.py +++ b/migrations/versions/0355_add_webauthn_table.py @@ -5,6 +5,7 @@ Create Date: 2021-05-07 17:04:22.017137 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0356_add_webautn_auth_type.py b/migrations/versions/0356_add_webautn_auth_type.py index d9bbc9a56b..b79e1077d8 100644 --- a/migrations/versions/0356_add_webautn_auth_type.py +++ b/migrations/versions/0356_add_webautn_auth_type.py @@ -5,6 +5,7 @@ Create Date: 2021-05-13 12:42:45.190269 """ + from alembic import op revision = "0356_add_webautn_auth_type" diff --git a/migrations/versions/0357_validate_constraint.py b/migrations/versions/0357_validate_constraint.py index a558f8e7f3..354383da39 100644 --- a/migrations/versions/0357_validate_constraint.py +++ b/migrations/versions/0357_validate_constraint.py @@ -5,6 +5,7 @@ Create Date: 2021-05-13 14:15:25.259991 """ + from alembic import op revision = "0357_validate_constraint" diff --git a/migrations/versions/0358_operator_channel.py b/migrations/versions/0358_operator_channel.py index 6520ff46d8..f436155344 100644 --- a/migrations/versions/0358_operator_channel.py +++ b/migrations/versions/0358_operator_channel.py @@ -5,6 +5,7 @@ Create Date: 2021-06-09 13:44:12.479191 """ + from alembic import op revision = "0358_operator_channel" diff --git a/migrations/versions/0359_more_permissions.py b/migrations/versions/0359_more_permissions.py index c14d4a346d..f52317eba2 100644 --- a/migrations/versions/0359_more_permissions.py +++ b/migrations/versions/0359_more_permissions.py @@ -5,6 +5,7 @@ Create Date: 2021-06-15 17:47:16.871071 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0360_remove_sched_notifications_.py b/migrations/versions/0360_remove_sched_notifications_.py index f749a2f085..f0f6e6fa5c 100644 --- a/migrations/versions/0360_remove_sched_notifications_.py +++ b/migrations/versions/0360_remove_sched_notifications_.py @@ -5,6 +5,7 @@ Create Date: 2021-06-07 09:09:06.376862 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0361_new_user_bcast_permissions.py b/migrations/versions/0361_new_user_bcast_permissions.py index 09d93d0bd9..931185839d 100644 --- a/migrations/versions/0361_new_user_bcast_permissions.py +++ b/migrations/versions/0361_new_user_bcast_permissions.py @@ -5,6 +5,7 @@ Create Date: 2021-06-30 11:42:32.780734 """ + from alembic import op revision = "0361_new_user_bcast_permissions" diff --git a/migrations/versions/0362_broadcast_msg_event.py b/migrations/versions/0362_broadcast_msg_event.py index 7c7ba4bca5..ed4ff13b0a 100644 --- a/migrations/versions/0362_broadcast_msg_event.py +++ b/migrations/versions/0362_broadcast_msg_event.py @@ -5,6 +5,7 @@ Create Date: 2020-12-04 15:06:22.544803 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0363_cancelled_by_api_key.py b/migrations/versions/0363_cancelled_by_api_key.py index 1729de4e8d..fb2d94ace3 100644 --- a/migrations/versions/0363_cancelled_by_api_key.py +++ b/migrations/versions/0363_cancelled_by_api_key.py @@ -3,6 +3,7 @@ Revises: 0362_broadcast_msg_event Create Date: 2022-02-09 14:05:27.750234 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0364_drop_old_column.py b/migrations/versions/0364_drop_old_column.py index ac33907133..adaddef367 100644 --- a/migrations/versions/0364_drop_old_column.py +++ b/migrations/versions/0364_drop_old_column.py @@ -5,6 +5,7 @@ Create Date: 2022-01-25 18:05:27.750234 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0365_add_nhs_branding.py b/migrations/versions/0365_add_nhs_branding.py index 7c0e0c203f..50412de688 100644 --- a/migrations/versions/0365_add_nhs_branding.py +++ b/migrations/versions/0365_add_nhs_branding.py @@ -5,6 +5,7 @@ Create Date: 2022-02-17 16:31:21.415065 """ + import os from alembic import op diff --git a/migrations/versions/0366_letter_rates_2022.py b/migrations/versions/0366_letter_rates_2022.py index 11af1adfea..c932e095cd 100644 --- a/migrations/versions/0366_letter_rates_2022.py +++ b/migrations/versions/0366_letter_rates_2022.py @@ -5,6 +5,7 @@ Create Date: 2022-03-01 14:00:00 """ + import itertools import uuid from datetime import datetime diff --git a/migrations/versions/0367_add_reach.py b/migrations/versions/0367_add_reach.py index 96a6e5e6be..991857d2a5 100644 --- a/migrations/versions/0367_add_reach.py +++ b/migrations/versions/0367_add_reach.py @@ -5,6 +5,7 @@ Create Date: 2022-03-24 16:00:00 """ + import itertools import uuid from datetime import datetime diff --git a/migrations/versions/0368_move_orgs_to_nhs_branding_.py b/migrations/versions/0368_move_orgs_to_nhs_branding_.py index 7115f10485..8902997c69 100644 --- a/migrations/versions/0368_move_orgs_to_nhs_branding_.py +++ b/migrations/versions/0368_move_orgs_to_nhs_branding_.py @@ -5,6 +5,7 @@ Create Date: 2022-04-12 18:22:12.069016 """ + from alembic import op revision = "0368_move_orgs_to_nhs_branding" diff --git a/migrations/versions/0369_update_sms_rates.py b/migrations/versions/0369_update_sms_rates.py index 76a360b7c6..94d83492f7 100644 --- a/migrations/versions/0369_update_sms_rates.py +++ b/migrations/versions/0369_update_sms_rates.py @@ -5,6 +5,7 @@ Create Date: 2022-04-26 09:39:45.260951 """ + import uuid from alembic import op diff --git a/migrations/versions/0370_remove_reach.py b/migrations/versions/0370_remove_reach.py index 2ed2f6f5f0..0b5bcd3d04 100644 --- a/migrations/versions/0370_remove_reach.py +++ b/migrations/versions/0370_remove_reach.py @@ -5,6 +5,7 @@ Create Date: 2022-04-27 16:00:00 """ + import itertools import uuid from datetime import datetime diff --git a/migrations/versions/0371_fix_apr_2022_sms_rate.py b/migrations/versions/0371_fix_apr_2022_sms_rate.py index 83e523341f..f46597e7d9 100644 --- a/migrations/versions/0371_fix_apr_2022_sms_rate.py +++ b/migrations/versions/0371_fix_apr_2022_sms_rate.py @@ -5,6 +5,7 @@ Create Date: 2022-04-26 09:39:45.260951 """ + import uuid from alembic import op diff --git a/migrations/versions/0374_email_branding_to_org.py b/migrations/versions/0374_email_branding_to_org.py index 3fee399f7b..ce7f2fd725 100644 --- a/migrations/versions/0374_email_branding_to_org.py +++ b/migrations/versions/0374_email_branding_to_org.py @@ -5,6 +5,7 @@ Create Date: 2022-06-16 14:58:49.602967 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0375_doc_download_verify_email.py b/migrations/versions/0375_doc_download_verify_email.py index b60674fb3a..8cf9f32593 100644 --- a/migrations/versions/0375_doc_download_verify_email.py +++ b/migrations/versions/0375_doc_download_verify_email.py @@ -5,6 +5,7 @@ Create Date: 2020-09-13 28:17:17.110495 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0376_email_branding_pools.py b/migrations/versions/0376_email_branding_pools.py index c4b2e570a5..e20a5fed0a 100644 --- a/migrations/versions/0376_email_branding_pools.py +++ b/migrations/versions/0376_email_branding_pools.py @@ -5,6 +5,7 @@ Create Date: 2022-08-22 13:47:31.180072 """ + import textwrap from alembic import op diff --git a/migrations/versions/0377_populate_org_brand_pools.py b/migrations/versions/0377_populate_org_brand_pools.py index 4bf547158b..db67019576 100644 --- a/migrations/versions/0377_populate_org_brand_pools.py +++ b/migrations/versions/0377_populate_org_brand_pools.py @@ -5,6 +5,7 @@ Create Date: 2022-09-16 17:11:24.118619 """ + import textwrap from alembic import op diff --git a/migrations/versions/0378_remove_doc_download_perm.py b/migrations/versions/0378_remove_doc_download_perm.py index 31ae584518..61d6e77e20 100644 --- a/migrations/versions/0378_remove_doc_download_perm.py +++ b/migrations/versions/0378_remove_doc_download_perm.py @@ -5,6 +5,7 @@ Create Date: 2022-10-12 11:55:28.906151 """ + from alembic import op revision = "0378_remove_doc_download_perm" diff --git a/migrations/versions/0379_update_archived_users.py b/migrations/versions/0379_update_archived_users.py index c80b026ae3..c46072120e 100644 --- a/migrations/versions/0379_update_archived_users.py +++ b/migrations/versions/0379_update_archived_users.py @@ -5,6 +5,7 @@ Create Date: 2022-10-10 12:45:47.519550 """ + import textwrap from alembic import op diff --git a/migrations/versions/0380_email_branding_cols_.py b/migrations/versions/0380_email_branding_cols_.py index 769b97fc2f..cd6383898d 100644 --- a/migrations/versions/0380_email_branding_cols_.py +++ b/migrations/versions/0380_email_branding_cols_.py @@ -3,6 +3,7 @@ Revises: 0379_update_archived_users Create Date: 2022-10-19 12:12:15.225244 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0381_letter_branding_to_org.py b/migrations/versions/0381_letter_branding_to_org.py index a528e9d492..3423bd930d 100644 --- a/migrations/versions/0381_letter_branding_to_org.py +++ b/migrations/versions/0381_letter_branding_to_org.py @@ -5,6 +5,7 @@ Create Date: 2022-10-21 14:26:12.421574 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0382_nhs_letter_branding_id.py b/migrations/versions/0382_nhs_letter_branding_id.py index 53b040ac23..bb494bd906 100644 --- a/migrations/versions/0382_nhs_letter_branding_id.py +++ b/migrations/versions/0382_nhs_letter_branding_id.py @@ -5,6 +5,7 @@ Create Date: 2022-11-15 07:57:49.060820 """ + import os from alembic import op diff --git a/migrations/versions/0383_webauthn_cred_logged_in_at.py b/migrations/versions/0383_webauthn_cred_logged_in_at.py index 298276d93a..a037528a94 100644 --- a/migrations/versions/0383_webauthn_cred_logged_in_at.py +++ b/migrations/versions/0383_webauthn_cred_logged_in_at.py @@ -5,6 +5,7 @@ Create Date: 2022-10-21 14:26:12.421574 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0384_add_nhs_to_letter_pools.py b/migrations/versions/0384_add_nhs_to_letter_pools.py index 11d61ae2de..834ff97102 100644 --- a/migrations/versions/0384_add_nhs_to_letter_pools.py +++ b/migrations/versions/0384_add_nhs_to_letter_pools.py @@ -5,6 +5,7 @@ Create Date: 2022-11-17 13:59:56.978865 """ + from alembic import op revision = "0384_add_nhs_to_letter_pools" diff --git a/migrations/versions/0385_letter_branding_pools.py b/migrations/versions/0385_letter_branding_pools.py index b6146c74d5..77da1c3572 100644 --- a/migrations/versions/0385_letter_branding_pools.py +++ b/migrations/versions/0385_letter_branding_pools.py @@ -5,6 +5,7 @@ Create Date: 2022-11-18 11:46:27.954516 """ + from alembic import op revision = "0385_letter_branding_pools" diff --git a/migrations/versions/0386_email_branding_alt_text.py b/migrations/versions/0386_email_branding_alt_text.py index 1a808a3cc5..bc509fa9eb 100644 --- a/migrations/versions/0386_email_branding_alt_text.py +++ b/migrations/versions/0386_email_branding_alt_text.py @@ -5,6 +5,7 @@ Create Date: 2022-10-21 14:26:12.421574 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0387_migrate_alt_text.py b/migrations/versions/0387_migrate_alt_text.py index f24db6d648..20b6530846 100644 --- a/migrations/versions/0387_migrate_alt_text.py +++ b/migrations/versions/0387_migrate_alt_text.py @@ -5,6 +5,7 @@ Create Date: 2022-11-21 19:05:49.047224 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0388_populate_letter_branding.py b/migrations/versions/0388_populate_letter_branding.py index b90df0455a..6cfda44378 100644 --- a/migrations/versions/0388_populate_letter_branding.py +++ b/migrations/versions/0388_populate_letter_branding.py @@ -5,6 +5,7 @@ Create Date: 2022-11-24 14:04:41.456302 """ + from alembic import op revision = "0388_populate_letter_branding" diff --git a/migrations/versions/0389_split_rate_limits.py b/migrations/versions/0389_split_rate_limits.py index bfbd52c86c..c8843f3b3d 100644 --- a/migrations/versions/0389_split_rate_limits.py +++ b/migrations/versions/0389_split_rate_limits.py @@ -5,6 +5,7 @@ Create Date: 2022-12-11 08:01:58.001061 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0390_require_rate_limit_value.py b/migrations/versions/0390_require_rate_limit_value.py index 1208d25628..9ab56371e4 100644 --- a/migrations/versions/0390_require_rate_limit_value.py +++ b/migrations/versions/0390_require_rate_limit_value.py @@ -5,6 +5,7 @@ Create Date: 2022-12-16 16:07:34.859641 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0391_add_go_live_columns.py b/migrations/versions/0391_add_go_live_columns.py index 660c7f91bd..09751ca68a 100644 --- a/migrations/versions/0391_add_go_live_columns.py +++ b/migrations/versions/0391_add_go_live_columns.py @@ -5,6 +5,7 @@ Create Date: 2022-12-19 08:01:58.001061 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0392_go_live_cols_non_nullable.py b/migrations/versions/0392_go_live_cols_non_nullable.py index 0809a1b009..263455fcf7 100644 --- a/migrations/versions/0392_go_live_cols_non_nullable.py +++ b/migrations/versions/0392_go_live_cols_non_nullable.py @@ -5,6 +5,7 @@ Create Date: 2022-12-20 08:01:58.001061 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0393_add_go_live_template.py b/migrations/versions/0393_add_go_live_template.py index 8ca0e50b2d..f392fd2e61 100644 --- a/migrations/versions/0393_add_go_live_template.py +++ b/migrations/versions/0393_add_go_live_template.py @@ -5,6 +5,7 @@ Create Date: 2022-12-28 12:12:12.929661 """ + import textwrap from alembic import op diff --git a/migrations/versions/0394_letter_branding_cols.py b/migrations/versions/0394_letter_branding_cols.py index 5501768481..9dc0c89230 100644 --- a/migrations/versions/0394_letter_branding_cols.py +++ b/migrations/versions/0394_letter_branding_cols.py @@ -5,6 +5,7 @@ Create Date: 2023-01-05 14:12:47.272639 """ + from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0395_migrate_rate_limits.py b/migrations/versions/0395_migrate_rate_limits.py index 99c590a289..cc297d7e3d 100644 --- a/migrations/versions/0395_migrate_rate_limits.py +++ b/migrations/versions/0395_migrate_rate_limits.py @@ -5,6 +5,7 @@ Create Date: 2023-01-06 09:27:38.125105 """ + from alembic import op revision = "0395_migrate_rate_limits" diff --git a/migrations/versions/0396_make_research_mode_nullable.py b/migrations/versions/0396_make_research_mode_nullable.py index d1e5dae732..603c60d665 100644 --- a/migrations/versions/0396_make_research_mode_nullable.py +++ b/migrations/versions/0396_make_research_mode_nullable.py @@ -5,6 +5,7 @@ Create Date: 2023-01-11 16:40:21.372085 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0397_drop_research_mode.py b/migrations/versions/0397_drop_research_mode.py index 34f3aed7d7..feb64641ff 100644 --- a/migrations/versions/0397_drop_research_mode.py +++ b/migrations/versions/0397_drop_research_mode.py @@ -5,6 +5,7 @@ Create Date: 2023-01-12 11:43:58.606291 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0398_active_email_branding.py b/migrations/versions/0398_active_email_branding.py index 29ed0568a7..3a7e943556 100644 --- a/migrations/versions/0398_active_email_branding.py +++ b/migrations/versions/0398_active_email_branding.py @@ -5,6 +5,7 @@ Create Date: 2023-01-12 16:45:46.505237 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0399_nullable_message_limit.py b/migrations/versions/0399_nullable_message_limit.py index bac3174e70..90540721f5 100644 --- a/migrations/versions/0399_nullable_message_limit.py +++ b/migrations/versions/0399_nullable_message_limit.py @@ -5,6 +5,7 @@ Create Date: 2023-01-18 13:13:06.439154 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0400_non_nullable_ids.py b/migrations/versions/0400_non_nullable_ids.py index 74d963d199..78820e7e28 100644 --- a/migrations/versions/0400_non_nullable_ids.py +++ b/migrations/versions/0400_non_nullable_ids.py @@ -5,6 +5,7 @@ Create Date: 2023-01-19 16:13:38.601465 """ + from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0401_prefix_sms_non_null.py b/migrations/versions/0401_prefix_sms_non_null.py index 9a9fa23352..a6057ef376 100644 --- a/migrations/versions/0401_prefix_sms_non_null.py +++ b/migrations/versions/0401_prefix_sms_non_null.py @@ -5,6 +5,7 @@ Create Date: 2023-01-19 16:56:49.635251 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0402_inbound_sms_history.py b/migrations/versions/0402_inbound_sms_history.py index abef389054..23ea0aad3f 100644 --- a/migrations/versions/0402_inbound_sms_history.py +++ b/migrations/versions/0402_inbound_sms_history.py @@ -5,6 +5,7 @@ Create Date: 2023-01-19 17:32:56.494917 """ + from alembic import op revision = "0402_inbound_sms_history" diff --git a/migrations/versions/0403_letter_rates_jan_2023.py b/migrations/versions/0403_letter_rates_jan_2023.py index 4e3449c682..5807ac5983 100644 --- a/migrations/versions/0403_letter_rates_jan_2023.py +++ b/migrations/versions/0403_letter_rates_jan_2023.py @@ -5,6 +5,7 @@ Create Date: 2023-01-24 16:29:25.891380 """ + import itertools import uuid from datetime import datetime diff --git a/migrations/versions/0404_remove_message_limit.py b/migrations/versions/0404_remove_message_limit.py index 16071da824..6515376179 100644 --- a/migrations/versions/0404_remove_message_limit.py +++ b/migrations/versions/0404_remove_message_limit.py @@ -5,6 +5,7 @@ Create Date: 2023-01-27 11:14:29.038116 """ + import sqlalchemy as sa from alembic import op diff --git a/migrations/versions/0405_template_formatting_flags.py b/migrations/versions/0405_template_formatting_flags.py index 2adfb09071..28e1928f01 100644 --- a/migrations/versions/0405_template_formatting_flags.py +++ b/migrations/versions/0405_template_formatting_flags.py @@ -5,6 +5,7 @@ Create Date: 2023-02-22 10:41:51.006163 """ + from alembic import op diff --git a/migrations/versions/0406_1_april_2023_sms_rates.py b/migrations/versions/0406_1_april_2023_sms_rates.py index 6c5132c1d1..f0f9fe7484 100644 --- a/migrations/versions/0406_1_april_2023_sms_rates.py +++ b/migrations/versions/0406_1_april_2023_sms_rates.py @@ -5,6 +5,7 @@ Create Date: 2023-03-06 11:32:20.588364 """ + import uuid from alembic import op diff --git a/migrations/versions/0407_letter_attachments.py b/migrations/versions/0407_letter_attachments.py index 1742a547e8..3acc86cbd3 100644 --- a/migrations/versions/0407_letter_attachments.py +++ b/migrations/versions/0407_letter_attachments.py @@ -5,6 +5,7 @@ Create Date: 2023-03-09 08:45:00.990562 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0408_perm_ask_to_join_service.py b/migrations/versions/0408_perm_ask_to_join_service.py index 96d2250387..248d8df545 100644 --- a/migrations/versions/0408_perm_ask_to_join_service.py +++ b/migrations/versions/0408_perm_ask_to_join_service.py @@ -5,6 +5,7 @@ Create Date: 2023-03-09 08:45:00.990562 """ + import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0409_annual_allowance.py b/migrations/versions/0409_annual_allowance.py index e4ce210956..2224df1b5e 100644 --- a/migrations/versions/0409_annual_allowance.py +++ b/migrations/versions/0409_annual_allowance.py @@ -5,6 +5,7 @@ Create Date: 2023-04-20 13:01:09.425646 """ + from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0410_drop_unused_allowance.py b/migrations/versions/0410_drop_unused_allowance.py index 5657f890a7..d71fb7bc67 100644 --- a/migrations/versions/0410_drop_unused_allowance.py +++ b/migrations/versions/0410_drop_unused_allowance.py @@ -5,6 +5,7 @@ Create Date: 2023-04-26 07:52:19.822068 """ + from alembic import op import sqlalchemy as sa diff --git a/migrations/versions/0411_contact_list_idx.py b/migrations/versions/0411_contact_list_idx.py index 89716542be..a667923d80 100644 --- a/migrations/versions/0411_contact_list_idx.py +++ b/migrations/versions/0411_contact_list_idx.py @@ -5,6 +5,7 @@ Create Date: 2023-05-11 15:00:59.123645 """ + from alembic import op diff --git a/migrations/versions/0412_letter_despatch.py b/migrations/versions/0412_letter_despatch.py index 5008a7d6d0..8354e78c83 100644 --- a/migrations/versions/0412_letter_despatch.py +++ b/migrations/versions/0412_letter_despatch.py @@ -5,6 +5,7 @@ Create Date: 2023-05-22 15:41:45.251681 """ + from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0413_ft_billing_letter_despatch.py b/migrations/versions/0413_ft_billing_letter_despatch.py index 1bf2c17ce9..23e5c60acd 100644 --- a/migrations/versions/0413_ft_billing_letter_despatch.py +++ b/migrations/versions/0413_ft_billing_letter_despatch.py @@ -5,6 +5,7 @@ Create Date: 2023-05-24 08:42:11.354797 """ + from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0414_org_user_permissions.py b/migrations/versions/0414_org_user_permissions.py index cf7c5cd93a..bb66282c79 100644 --- a/migrations/versions/0414_org_user_permissions.py +++ b/migrations/versions/0414_org_user_permissions.py @@ -5,6 +5,7 @@ Create Date: 2023-06-09 13:27:00.294865 """ + from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0415_org_invite_perms.py b/migrations/versions/0415_org_invite_perms.py index 30939699c1..91b58d034a 100644 --- a/migrations/versions/0415_org_invite_perms.py +++ b/migrations/versions/0415_org_invite_perms.py @@ -5,6 +5,7 @@ Create Date: 2023-06-14 07:38:10.479332 """ + from alembic import op import sqlalchemy as sa diff --git a/migrations/versions/0416_add_org_user_perms.py b/migrations/versions/0416_add_org_user_perms.py index 1f7b0252ce..9c2f60c9f4 100644 --- a/migrations/versions/0416_add_org_user_perms.py +++ b/migrations/versions/0416_add_org_user_perms.py @@ -5,6 +5,7 @@ Create Date: 2023-06-19 12:43:09.194732 """ + import uuid from datetime import datetime diff --git a/migrations/versions/0417_remove_null_constraint.py b/migrations/versions/0417_remove_null_constraint.py index 53509eac3d..fba88cc6b7 100644 --- a/migrations/versions/0417_remove_null_constraint.py +++ b/migrations/versions/0417_remove_null_constraint.py @@ -5,6 +5,7 @@ Create Date: 2023-06-21 12:45:27.185814 """ + from alembic import op diff --git a/migrations/versions/0418_readd_null_constraint.py b/migrations/versions/0418_readd_null_constraint.py index 4d447892fd..fc5bb65282 100644 --- a/migrations/versions/0418_readd_null_constraint.py +++ b/migrations/versions/0418_readd_null_constraint.py @@ -5,6 +5,7 @@ Create Date: 2023-06-21 13:40:37.866124 """ + from alembic import op diff --git a/migrations/versions/0419_take_part_in_research.py b/migrations/versions/0419_take_part_in_research.py index 274bde9d73..63f8cb52c8 100644 --- a/migrations/versions/0419_take_part_in_research.py +++ b/migrations/versions/0419_take_part_in_research.py @@ -5,6 +5,7 @@ Create Date: 2023-07-05 12:31:03.540011 """ + from alembic import op import sqlalchemy as sa diff --git a/migrations/versions/0422_unique_service_name_1.py b/migrations/versions/0422_unique_service_name_1.py index 3989396d0d..0d540ce126 100644 --- a/migrations/versions/0422_unique_service_name_1.py +++ b/migrations/versions/0422_unique_service_name_1.py @@ -5,6 +5,7 @@ Create Date: 2023-08-24 16:26:03.488048 """ + from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0423_bilingual_templates.py b/migrations/versions/0423_bilingual_templates.py index ac2a72a6a6..b337434c63 100644 --- a/migrations/versions/0423_bilingual_templates.py +++ b/migrations/versions/0423_bilingual_templates.py @@ -5,6 +5,7 @@ Create Date: 2023-08-30 17:26:28.925639 """ + from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql diff --git a/migrations/versions/0424_letter_languages_constraint.py b/migrations/versions/0424_letter_languages_constraint.py index 5c0980ae14..09aaaefb81 100644 --- a/migrations/versions/0424_letter_languages_constraint.py +++ b/migrations/versions/0424_letter_languages_constraint.py @@ -5,6 +5,7 @@ Create Date: 2023-09-07 14:00:28.925639 """ + from alembic import op diff --git a/migrations/versions/0425_notify_user_name.py b/migrations/versions/0425_notify_user_name.py index 27421868ae..e5b464ac39 100644 --- a/migrations/versions/0425_notify_user_name.py +++ b/migrations/versions/0425_notify_user_name.py @@ -5,6 +5,7 @@ Create Date: 2023-09-14 14:00:28.925639 """ + from alembic import op diff --git a/migrations/versions/0426_n_history_created_at.py b/migrations/versions/0426_n_history_created_at.py index 8ea91afb28..c513815132 100644 --- a/migrations/versions/0426_n_history_created_at.py +++ b/migrations/versions/0426_n_history_created_at.py @@ -5,6 +5,7 @@ Create Date: 2023-09-17 15:17:58.545277 """ + from alembic import op import sqlalchemy as sa diff --git a/migrations/versions/0427_unique_service_name_2.py b/migrations/versions/0427_unique_service_name_2.py index ae24aecddf..2a8c69d7bf 100644 --- a/migrations/versions/0427_unique_service_name_2.py +++ b/migrations/versions/0427_unique_service_name_2.py @@ -5,6 +5,7 @@ Create Date: 2023-09-01 10:10:19.011060 """ + from alembic import op import sqlalchemy as sa diff --git a/migrations/versions/0428_drop_email_from.py b/migrations/versions/0428_drop_email_from.py index fe13c29530..829321ced7 100644 --- a/migrations/versions/0428_drop_email_from.py +++ b/migrations/versions/0428_drop_email_from.py @@ -5,6 +5,7 @@ Create Date: 2023-09-29 18:47:48.703294 """ + from alembic import op import sqlalchemy as sa diff --git a/migrations/versions/0431_add_new_email_sender_fields.py b/migrations/versions/0431_add_new_email_sender_fields.py index b0382cdde5..88bf454849 100644 --- a/migrations/versions/0431_add_new_email_sender_fields.py +++ b/migrations/versions/0431_add_new_email_sender_fields.py @@ -5,6 +5,7 @@ Create Date: 2023-10-16 15:46:30.137552 """ + from alembic import op import sqlalchemy as sa diff --git a/migrations/versions/0432_go_live_templates.py b/migrations/versions/0432_go_live_templates.py index beb2e64673..51cf9c3ea0 100644 --- a/migrations/versions/0432_go_live_templates.py +++ b/migrations/versions/0432_go_live_templates.py @@ -5,6 +5,7 @@ Create Date: 2023-10-31 13:23:51.260909 """ + import textwrap from alembic import op diff --git a/migrations/versions/0433_migrate_email_local_part.py b/migrations/versions/0433_migrate_email_local_part.py index 19ad17fc32..fdd8ad40b5 100644 --- a/migrations/versions/0433_migrate_email_local_part.py +++ b/migrations/versions/0433_migrate_email_local_part.py @@ -5,6 +5,7 @@ Create Date: 2023-11-15 22:27:23.511256 """ + from alembic import op revision = "0433_migrate_email_local_part" diff --git a/migrations/versions/0434_s_add_not_null_check.py b/migrations/versions/0434_s_add_not_null_check.py index 7cf7de3e2a..c835ab575c 100644 --- a/migrations/versions/0434_s_add_not_null_check.py +++ b/migrations/versions/0434_s_add_not_null_check.py @@ -5,6 +5,7 @@ Create Date: 2023-11-15 22:27:23.511256 """ + from alembic import op from sqlalchemy import column diff --git a/migrations/versions/0435_sh_add_not_null_check.py b/migrations/versions/0435_sh_add_not_null_check.py index 131934c60c..fce84ec4b3 100644 --- a/migrations/versions/0435_sh_add_not_null_check.py +++ b/migrations/versions/0435_sh_add_not_null_check.py @@ -5,6 +5,7 @@ Create Date: 2023-11-15 22:27:23.511256 """ + from alembic import op from sqlalchemy import column diff --git a/migrations/versions/0436_validate_not_null_check.py b/migrations/versions/0436_validate_not_null_check.py index fe8a6a9f57..fa4f8ab04f 100644 --- a/migrations/versions/0436_validate_not_null_check.py +++ b/migrations/versions/0436_validate_not_null_check.py @@ -5,6 +5,7 @@ Create Date: 2023-11-15 22:27:23.511256 """ + from alembic import op revision = "0436_validate_not_null_check" diff --git a/migrations/versions/0437_s_swap_check_for_not_null.py b/migrations/versions/0437_s_swap_check_for_not_null.py index 91e0464b8b..030bf71669 100644 --- a/migrations/versions/0437_s_swap_check_for_not_null.py +++ b/migrations/versions/0437_s_swap_check_for_not_null.py @@ -5,6 +5,7 @@ Create Date: 2023-11-15 22:27:23.511256 """ + from alembic import op from sqlalchemy import column diff --git a/migrations/versions/0438_sh_swap_check_for_not_null.py b/migrations/versions/0438_sh_swap_check_for_not_null.py index 4cdd1fd233..c40592d3df 100644 --- a/migrations/versions/0438_sh_swap_check_for_not_null.py +++ b/migrations/versions/0438_sh_swap_check_for_not_null.py @@ -5,6 +5,7 @@ Create Date: 2023-11-15 22:27:23.511256 """ + from alembic import op from sqlalchemy import column diff --git a/migrations/versions/0440_request_invite_templates.py b/migrations/versions/0440_request_invite_templates.py index db6bdcbbb1..8b3a06e24c 100644 --- a/migrations/versions/0440_request_invite_templates.py +++ b/migrations/versions/0440_request_invite_templates.py @@ -5,6 +5,7 @@ Create Date: 2023-12-11 16:21:05.947886 """ + import textwrap from alembic import op from flask import current_app diff --git a/migrations/versions/0441_intl_letters_jan_24.py b/migrations/versions/0441_intl_letters_jan_24.py index 6133d64f78..4587b7662f 100644 --- a/migrations/versions/0441_intl_letters_jan_24.py +++ b/migrations/versions/0441_intl_letters_jan_24.py @@ -5,6 +5,7 @@ Create Date: 2024-01-02 12:39:29.779099 """ + from sqlalchemy.sql import text from alembic import op from datetime import datetime diff --git a/requirements_for_test.txt b/requirements_for_test.txt index 811c4c1833..bcc0a80314 100644 --- a/requirements_for_test.txt +++ b/requirements_for_test.txt @@ -1,5 +1,5 @@ -r requirements.txt -black==23.10.1 # Also update `.pre-commit-config.yaml` if this changes +black==24.10.0 # Also update `.pre-commit-config.yaml` if this changes ruff==0.0.275 # Also update `.pre-commit-config.yaml` if this changes flaky==3.7.0 diff --git a/tests/app/celery/test_service_callback_tasks.py b/tests/app/celery/test_service_callback_tasks.py index 083a170d87..8dec22e010 100644 --- a/tests/app/celery/test_service_callback_tasks.py +++ b/tests/app/celery/test_service_callback_tasks.py @@ -155,9 +155,9 @@ def _set_up_data_for_status_update(callback_api, notification): "notification_to": notification.to, "notification_status": notification.status, "notification_created_at": notification.created_at.strftime(DATETIME_FORMAT), - "notification_updated_at": notification.updated_at.strftime(DATETIME_FORMAT) - if notification.updated_at - else None, + "notification_updated_at": ( + notification.updated_at.strftime(DATETIME_FORMAT) if notification.updated_at else None + ), "notification_sent_at": notification.sent_at.strftime(DATETIME_FORMAT) if notification.sent_at else None, "notification_type": notification.notification_type, "service_callback_api_url": callback_api.url, diff --git a/tests/app/v2/notifications/test_post_notifications.py b/tests/app/v2/notifications/test_post_notifications.py index 28bbda5123..3942657fb3 100644 --- a/tests/app/v2/notifications/test_post_notifications.py +++ b/tests/app/v2/notifications/test_post_notifications.py @@ -1271,8 +1271,10 @@ def test_post_notifications_saves_email_or_sms_to_queue(client, notify_db_sessio ): template = create_template(service=service, content="((message))", template_type=notification_type) data = {"template_id": template.id, "personalisation": {"message": "Dear citizen, have a nice day"}} - data.update({"email_address": "joe.citizen@example.com"}) if notification_type == EMAIL_TYPE else data.update( - {"phone_number": "+447700900855"} + ( + data.update({"email_address": "joe.citizen@example.com"}) + if notification_type == EMAIL_TYPE + else data.update({"phone_number": "+447700900855"}) ) response = client.post( @@ -1320,8 +1322,10 @@ def test_post_notifications_saves_email_or_sms_normally_if_saving_to_queue_fails ): template = create_template(service=service, content="((message))", template_type=notification_type) data = {"template_id": template.id, "personalisation": {"message": "Dear citizen, have a nice day"}} - data.update({"email_address": "joe.citizen@example.com"}) if notification_type == EMAIL_TYPE else data.update( - {"phone_number": "+447700900855"} + ( + data.update({"email_address": "joe.citizen@example.com"}) + if notification_type == EMAIL_TYPE + else data.update({"phone_number": "+447700900855"}) ) json_resp = api_client_request.post( @@ -1356,8 +1360,10 @@ def test_post_notifications_doesnt_use_save_queue_for_test_notifications( ): template = create_template(service=service, content="((message))", template_type=notification_type) data = {"template_id": template.id, "personalisation": {"message": "Dear citizen, have a nice day"}} - data.update({"email_address": "joe.citizen@example.com"}) if notification_type == EMAIL_TYPE else data.update( - {"phone_number": "+447700900855"} + ( + data.update({"email_address": "joe.citizen@example.com"}) + if notification_type == EMAIL_TYPE + else data.update({"phone_number": "+447700900855"}) ) json_resp = api_client_request.post( From d59705fa129caf1e7ff073abbf15a693551f3fbf Mon Sep 17 00:00:00 2001 From: Pier-Angelo Gaetani Date: Mon, 9 Dec 2024 12:03:45 +0100 Subject: [PATCH 04/28] outputs for workflow --- .github/workflows/pr.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index e615f5ace7..afe7e68289 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -54,6 +54,9 @@ jobs: custom-arguments: "-n auto --max-fail=10" continue-on-error: true + outputs: + tag: ${{ steps.set-tag.outputs.tag }} + docker-build-and-push: runs-on: ubuntu-latest needs: app-build-and-test @@ -63,7 +66,7 @@ jobs: - name: Generate version.py before building image run: | - echo -e "__git_commit__ = \"${{ github.sha }}\"\n__time__ = \"$(date)\"\n__version__ = \"${{ env.TAG }}\"" > ./app/version.py + echo -e "__git_commit__ = \"${{ github.sha }}\"\n__time__ = \"$(date)\"\n__version__ = \"${{ needs.app-build-and-test.outputs.tag }}\"" > ./app/version.py - uses: docker/login-action@v3 with: @@ -78,4 +81,4 @@ jobs: with: file: docker/Dockerfile push: true - tags: worthnl/notifynl-api:${{ env.TAG }} \ No newline at end of file + tags: worthnl/notifynl-api:${{ needs.app-build-and-test.outputs.tag }} \ No newline at end of file From da25a354f9c4d7387bbc24e5e7af6bc61dffc2be Mon Sep 17 00:00:00 2001 From: Pier-Angelo Gaetani Date: Mon, 9 Dec 2024 12:05:08 +0100 Subject: [PATCH 05/28] outputs for workflow --- .github/workflows/pr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index afe7e68289..2e46047782 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -54,8 +54,8 @@ jobs: custom-arguments: "-n auto --max-fail=10" continue-on-error: true - outputs: - tag: ${{ steps.set-tag.outputs.tag }} + outputs: + tag: ${{ steps.set-tag.outputs.tag }} docker-build-and-push: runs-on: ubuntu-latest From 2635fd67857961b91b3016d7f6b087a3ca6b6bc9 Mon Sep 17 00:00:00 2001 From: Pier-Angelo Gaetani Date: Mon, 9 Dec 2024 12:12:10 +0100 Subject: [PATCH 06/28] added cache for pip, moved tag to docker phase --- .github/workflows/pr.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 2e46047782..d369da3d83 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -22,9 +22,6 @@ jobs: with: timezoneLinux: "Europe/Amsterdam" - - name: Set TAG - run: echo "TAG=$(date +%Y%m%d).${{ github.run_number }}.dev" >> $GITHUB_ENV - - uses: actions/checkout@v4 - uses: gerlero/apt-install@v1 @@ -35,6 +32,8 @@ jobs: - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: pyproject.toml - uses: BSFishy/pip-action@v1 with: @@ -64,9 +63,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set TAG + run: echo "TAG=$(date +%Y%m%d).${{ github.run_number }}.dev" >> $GITHUB_ENV + - name: Generate version.py before building image run: | - echo -e "__git_commit__ = \"${{ github.sha }}\"\n__time__ = \"$(date)\"\n__version__ = \"${{ needs.app-build-and-test.outputs.tag }}\"" > ./app/version.py + echo -e "__git_commit__ = \"${{ github.sha }}\"\n__time__ = \"$(date)\"\n__version__ = \"${{ env.TAG }}\"" > ./app/version.py - uses: docker/login-action@v3 with: @@ -81,4 +83,4 @@ jobs: with: file: docker/Dockerfile push: true - tags: worthnl/notifynl-api:${{ needs.app-build-and-test.outputs.tag }} \ No newline at end of file + tags: worthnl/notifynl-api:${{ env.TAG }} \ No newline at end of file From 38a50dd7271283c14e49d9207a432554733c58a8 Mon Sep 17 00:00:00 2001 From: Pier-Angelo Gaetani Date: Mon, 9 Dec 2024 12:24:38 +0100 Subject: [PATCH 07/28] dockerfile invalid formatting, pytest ini maxfail args --- .github/workflows/pr.yaml | 1 - docker/Dockerfile | 6 +++--- pytest.ini | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index d369da3d83..a29e615a12 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -50,7 +50,6 @@ jobs: with: verbose: false job-summary: true - custom-arguments: "-n auto --max-fail=10" continue-on-error: true outputs: diff --git a/docker/Dockerfile b/docker/Dockerfile index 7590088e44..a5eebf698b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-slim-bullseye as base +FROM python:3.11-slim-bullseye AS base ENV DEBIAN_FRONTEND=noninteractive ENV PYTHONUNBUFFERED=1 @@ -57,7 +57,7 @@ RUN chown -R notify:notify /home/vcap/app && \ ENTRYPOINT [ "/home/vcap/app/entrypoint.sh" ] ##### Test Image ############################################################## -FROM production as test +FROM production AS test USER root RUN echo "Install OS dependencies for test build" && \ @@ -86,7 +86,7 @@ RUN make bootstrap COPY --chown=notify:notify . . ##### Concourse Test Image ############################################################## -FROM production as concourse_tests +FROM production AS concourse_tests USER root RUN echo "Install OS dependencies for test build" && \ diff --git a/pytest.ini b/pytest.ini index 21050490ec..a0e129e944 100644 --- a/pytest.ini +++ b/pytest.ini @@ -6,5 +6,5 @@ env = FIRETEXT_API_KEY=Firetext NOTIFICATION_QUEUE_PREFIX=testing REDIS_ENABLED=0 -addopts = -p no:warnings +addopts = -p no:warnings --max-fail=10 xfail_strict = true From 572af5804c534b01aa555d0c7ee646654cc9792b Mon Sep 17 00:00:00 2001 From: Pier-Angelo Gaetani Date: Mon, 9 Dec 2024 12:31:27 +0100 Subject: [PATCH 08/28] pytest action deps --- .github/workflows/pr.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index a29e615a12..dbe456109f 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -43,6 +43,12 @@ jobs: - uses: jpetrucciani/black-check@master + - uses: BSFishy/pip-action@v1 + with: + packages: | + pytest-md + pytest-emoji + # TODO: fix automated tests # Connection from runner to test database is needed for tests to run # or somehow sending a custom job to k8s that would run the tests and report back From 8077a22abf67af4d083666263fc9c9ade13908e6 Mon Sep 17 00:00:00 2001 From: Pier-Angelo Gaetani Date: Mon, 9 Dec 2024 12:34:37 +0100 Subject: [PATCH 09/28] pytest maxfail fix --- pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index a0e129e944..764ca32dad 100644 --- a/pytest.ini +++ b/pytest.ini @@ -6,5 +6,5 @@ env = FIRETEXT_API_KEY=Firetext NOTIFICATION_QUEUE_PREFIX=testing REDIS_ENABLED=0 -addopts = -p no:warnings --max-fail=10 +addopts = -p no:warnings --maxfail=10 xfail_strict = true From 4db1ab15252c068e20b1fccfa8c9f5109ac01dfc Mon Sep 17 00:00:00 2001 From: Pier-Angelo Gaetani Date: Mon, 9 Dec 2024 14:52:25 +0100 Subject: [PATCH 10/28] output removal --- .github/workflows/pr.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index dbe456109f..ae146769c4 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -58,9 +58,6 @@ jobs: job-summary: true continue-on-error: true - outputs: - tag: ${{ steps.set-tag.outputs.tag }} - docker-build-and-push: runs-on: ubuntu-latest needs: app-build-and-test From 90cc3c2d2df03a00b8dd1b01a7c41ed42d3c2d26 Mon Sep 17 00:00:00 2001 From: Pier-Angelo Gaetani Date: Tue, 10 Dec 2024 10:31:24 +0100 Subject: [PATCH 11/28] formatting --- .github/workflows/merge.yaml | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/merge.yaml diff --git a/.github/workflows/merge.yaml b/.github/workflows/merge.yaml new file mode 100644 index 0000000000..ec3d645964 --- /dev/null +++ b/.github/workflows/merge.yaml @@ -0,0 +1,50 @@ +name: Merge tag and release + +on: + push: + branches: + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + # Don't want the tests running in parallel + cancel-in-progress: true + +jobs: + docker-build-and-push: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set TAG + run: echo "TAG=$(date +%Y%m%d).${{ github.run_number }}" >> $GITHUB_ENV + + - name: Generate version.py before building image + run: | + echo -e "__git_commit__ = \"${{ github.sha }}\"\n__time__ = \"$(date)\"\n__version__ = \"${{ env.TAG }}\"" > ./app/version.py + + - uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - uses: docker/setup-qemu-action@v3 + + - uses: docker/setup-buildx-action@v3 + + - uses: docker/build-push-action@v6 + with: + file: docker/Dockerfile + push: true + tags: worthnl/notifynl-api:latest,worthnl/notifynl-api:${{ env.TAG }} + + - uses: mathieudutour/github-tag-action@v6.2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + custom_tag: ${{ env.TAG }} + + - uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ env.TAG }} + make_latest: true From a529e8f0ac584922766db5fcda454ffc0a517515 Mon Sep 17 00:00:00 2001 From: pgaetani Date: Tue, 10 Dec 2024 14:21:00 +0100 Subject: [PATCH 12/28] output passing between phases --- .github/workflows/pr.yaml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index ae146769c4..0d2243cd60 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -51,7 +51,7 @@ jobs: # TODO: fix automated tests # Connection from runner to test database is needed for tests to run - # or somehow sending a custom job to k8s that would run the tests and report back + # or somehow sending a custom job to k8s that would run the tests and report back - uses: pavelzw/pytest-action@v2 with: verbose: false @@ -66,7 +66,11 @@ jobs: - uses: actions/checkout@v4 - name: Set TAG - run: echo "TAG=$(date +%Y%m%d).${{ github.run_number }}.dev" >> $GITHUB_ENV + id: set-tag + run: | + TAG=$(date +%Y%m%d).${{ github.run_number }}.dev + echo "TAG=$TAG" >> $GITHUB_ENV + echo "tag=$TAG" >> $GITHUB_OUTPUT - name: Generate version.py before building image run: | @@ -85,4 +89,14 @@ jobs: with: file: docker/Dockerfile push: true - tags: worthnl/notifynl-api:${{ env.TAG }} \ No newline at end of file + tags: worthnl/notifynl-api:${{ env.TAG }} + + outputs: + tag: ${{ steps.set-tag.outputs.tag }} + + helm-release: + runs-on: ubuntu-latest + needs: docker-build-and-push + + steps: + - run: echo "${{ needs.docker-build-and-push.outputs.tag }}" From 182716d5d27daedb6244e2dc522120f59f25f242 Mon Sep 17 00:00:00 2001 From: pgaetani Date: Tue, 10 Dec 2024 15:02:37 +0100 Subject: [PATCH 13/28] helm release --- .github/workflows/pr.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 0d2243cd60..69267e6a7c 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -97,6 +97,14 @@ jobs: helm-release: runs-on: ubuntu-latest needs: docker-build-and-push + environment: Test steps: - - run: echo "${{ needs.docker-build-and-push.outputs.tag }}" + - uses: licenseware/helm@v1 + with: + kubeconfig: ${{ secrets.K8S_CONFIG }} + action: upgrade -i + release-name: notifynl-api + namespace: ${{ secrets.K8S_NAMESPACE }} + reuse-values: 1 + values: dockerTagOverride=${{needs.docker-build-and-push.outputs.tag}} From 35c45d053f2296d018c271895c7b539290abf6cd Mon Sep 17 00:00:00 2001 From: pgaetani Date: Tue, 10 Dec 2024 15:17:12 +0100 Subject: [PATCH 14/28] helm setup --- .github/workflows/pr.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 69267e6a7c..df4102491c 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -100,6 +100,12 @@ jobs: environment: Test steps: + - run: | + curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null + sudo apt-get install apt-transport-https --yes + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list + sudo apt-get update + sudo apt-get install helm - uses: licenseware/helm@v1 with: kubeconfig: ${{ secrets.K8S_CONFIG }} From c27061419a1fdc8906371538031557cad80a77e7 Mon Sep 17 00:00:00 2001 From: pgaetani Date: Wed, 11 Dec 2024 09:31:47 +0100 Subject: [PATCH 15/28] helm binary test --- .github/workflows/pr.yaml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index df4102491c..5088cf4bf7 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -106,11 +106,4 @@ jobs: echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list sudo apt-get update sudo apt-get install helm - - uses: licenseware/helm@v1 - with: - kubeconfig: ${{ secrets.K8S_CONFIG }} - action: upgrade -i - release-name: notifynl-api - namespace: ${{ secrets.K8S_NAMESPACE }} - reuse-values: 1 - values: dockerTagOverride=${{needs.docker-build-and-push.outputs.tag}} + - run: helm --version From 768ad5153f80dac1e00287caa0fefbf46026cf6e Mon Sep 17 00:00:00 2001 From: pgaetani Date: Wed, 11 Dec 2024 11:25:07 +0100 Subject: [PATCH 16/28] helm binary test --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 5088cf4bf7..2f5c620131 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -106,4 +106,4 @@ jobs: echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list sudo apt-get update sudo apt-get install helm - - run: helm --version + - run: helm version From d791d6cd4d61c2fd4e09689e22c995359af2b70b Mon Sep 17 00:00:00 2001 From: pgaetani Date: Wed, 11 Dec 2024 12:50:43 +0100 Subject: [PATCH 17/28] helm setup with private charts --- .github/workflows/pr.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 2f5c620131..fc96e8b603 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -100,10 +100,14 @@ jobs: environment: Test steps: + - uses: actions/checkout@v4 + with: + repository: Worth-NL/notifynl-charts-private + token: ${{ secrets.GITHUB_TOKEN }} + - run: echo "${{ secrets.K8S_CONFIG }}" > $HOME/.kube/config + name: Setup k8s + - uses: azure/setup-helm@v1 + - run: helm repo add notifynl-private file://$GITHUB_WORKSPACE + name: Setup helm repo - run: | - curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null - sudo apt-get install apt-transport-https --yes - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list - sudo apt-get update - sudo apt-get install helm - - run: helm version + helm repo update From 38cc8989d1c8968ee30728f9a5029955c728c8fd Mon Sep 17 00:00:00 2001 From: pgaetani Date: Wed, 11 Dec 2024 13:00:35 +0100 Subject: [PATCH 18/28] git checkout ref --- .github/workflows/pr.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index fc96e8b603..9c65f63697 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -103,6 +103,7 @@ jobs: - uses: actions/checkout@v4 with: repository: Worth-NL/notifynl-charts-private + ref: main token: ${{ secrets.GITHUB_TOKEN }} - run: echo "${{ secrets.K8S_CONFIG }}" > $HOME/.kube/config name: Setup k8s From f8a5f85f2ba007db401d2081ba14868b3d750fa6 Mon Sep 17 00:00:00 2001 From: pgaetani Date: Wed, 11 Dec 2024 13:12:13 +0100 Subject: [PATCH 19/28] step names, PAT replacement --- .github/workflows/pr.yaml | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 9c65f63697..a4c2bb0e11 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -21,33 +21,41 @@ jobs: - uses: szenius/set-timezone@v2.0 with: timezoneLinux: "Europe/Amsterdam" + name: Set Timezone to Europe/Amsterdam - uses: actions/checkout@v4 + name: Checkout repository - uses: gerlero/apt-install@v1 with: packages: build-essential git libcurl4-openssl-dev curl libssl-dev install-recommends: false + name: Install OS dependencies (apt) - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: pip cache-dependency-path: pyproject.toml + name: Install Python [${{ matrix.python-version }}] and setup cache - uses: BSFishy/pip-action@v1 with: requirements: requirements_for_test.txt + name: Install application requirements (pip) - uses: astral-sh/ruff-action@v2 + name: Linting (ruff) - uses: jpetrucciani/black-check@master + name: Formatting (black) - uses: BSFishy/pip-action@v1 with: packages: | pytest-md pytest-emoji + name: Install test dependencies # TODO: fix automated tests # Connection from runner to test database is needed for tests to run @@ -57,6 +65,7 @@ jobs: verbose: false job-summary: true continue-on-error: true + name: Run tests (pytest) docker-build-and-push: runs-on: ubuntu-latest @@ -65,31 +74,35 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set TAG - id: set-tag - run: | + - run: | TAG=$(date +%Y%m%d).${{ github.run_number }}.dev echo "TAG=$TAG" >> $GITHUB_ENV echo "tag=$TAG" >> $GITHUB_OUTPUT + name: Set tag + id: set-tag - - name: Generate version.py before building image - run: | + - run: | echo -e "__git_commit__ = \"${{ github.sha }}\"\n__time__ = \"$(date)\"\n__version__ = \"${{ env.TAG }}\"" > ./app/version.py + name: Generate version.py before building image - uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + name: Login at dockerhub - uses: docker/setup-qemu-action@v3 + name: Setup QEMU - uses: docker/setup-buildx-action@v3 + name: Setup buildx - uses: docker/build-push-action@v6 with: file: docker/Dockerfile push: true tags: worthnl/notifynl-api:${{ env.TAG }} + name: Docker build and push ${{ env.TAG }} outputs: tag: ${{ steps.set-tag.outputs.tag }} @@ -104,11 +117,13 @@ jobs: with: repository: Worth-NL/notifynl-charts-private ref: main - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.WORTHNL_PAT }} + name: Checkout Worth-NL/notifynl-charts-private - run: echo "${{ secrets.K8S_CONFIG }}" > $HOME/.kube/config - name: Setup k8s + name: Setup kubernetes config - uses: azure/setup-helm@v1 - run: helm repo add notifynl-private file://$GITHUB_WORKSPACE - name: Setup helm repo + name: Setup helm repository - run: | helm repo update + name: Update helm repository From 6be8fb90d642df83c8bfa2b746fd9662b1209e3a Mon Sep 17 00:00:00 2001 From: pgaetani Date: Wed, 11 Dec 2024 13:23:59 +0100 Subject: [PATCH 20/28] k8s setup fix --- .github/workflows/pr.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index a4c2bb0e11..b237eae5eb 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -119,9 +119,12 @@ jobs: ref: main token: ${{ secrets.WORTHNL_PAT }} name: Checkout Worth-NL/notifynl-charts-private - - run: echo "${{ secrets.K8S_CONFIG }}" > $HOME/.kube/config + - run: | + mkdir -p $HOME/.kube + echo "${{ secrets.K8S_CONFIG }}" > $HOME/.kube/config name: Setup kubernetes config - uses: azure/setup-helm@v1 + name: Install helm - run: helm repo add notifynl-private file://$GITHUB_WORKSPACE name: Setup helm repository - run: | From 0ea7978f13c73766daac0f168d33a7d5487268a0 Mon Sep 17 00:00:00 2001 From: pgaetani Date: Wed, 11 Dec 2024 13:31:16 +0100 Subject: [PATCH 21/28] helm repo setup --- .github/workflows/pr.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index b237eae5eb..8f1264a8db 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -125,8 +125,8 @@ jobs: name: Setup kubernetes config - uses: azure/setup-helm@v1 name: Install helm - - run: helm repo add notifynl-private file://$GITHUB_WORKSPACE - name: Setup helm repository - run: | + helm init + helm repo add notifynl-private file://$GITHUB_WORKSPACE helm repo update - name: Update helm repository + name: Setup helm repository From 3a9d6d2409e3c2892697b21b4948cf7cd79f679b Mon Sep 17 00:00:00 2001 From: pgaetani Date: Wed, 11 Dec 2024 13:36:54 +0100 Subject: [PATCH 22/28] helm setup upgrade --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 8f1264a8db..f1069fb547 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -123,7 +123,7 @@ jobs: mkdir -p $HOME/.kube echo "${{ secrets.K8S_CONFIG }}" > $HOME/.kube/config name: Setup kubernetes config - - uses: azure/setup-helm@v1 + - uses: azure/setup-helm@v4 name: Install helm - run: | helm init From 75aeb8021d011bb7b25d6e3ac35f6288f84a5a64 Mon Sep 17 00:00:00 2001 From: pgaetani Date: Wed, 11 Dec 2024 13:43:51 +0100 Subject: [PATCH 23/28] helm init removal: --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index f1069fb547..f84224e163 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -126,7 +126,7 @@ jobs: - uses: azure/setup-helm@v4 name: Install helm - run: | - helm init + helm version helm repo add notifynl-private file://$GITHUB_WORKSPACE helm repo update name: Setup helm repository From 8208901a9b9715a49ea502f0f879b59f368640de Mon Sep 17 00:00:00 2001 From: pgaetani Date: Wed, 11 Dec 2024 13:54:20 +0100 Subject: [PATCH 24/28] path check --- .github/workflows/pr.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index f84224e163..447cb840e2 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -127,6 +127,6 @@ jobs: name: Install helm - run: | helm version - helm repo add notifynl-private file://$GITHUB_WORKSPACE - helm repo update - name: Setup helm repository + ls + ls $GITHUB_WORKSPACE + name: Deploy chart From 21f2f00b71aba5135c58363098e1a8484e7c24f6 Mon Sep 17 00:00:00 2001 From: pgaetani Date: Wed, 11 Dec 2024 14:04:17 +0100 Subject: [PATCH 25/28] helm release --- .github/workflows/pr.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 447cb840e2..e9dac31d8c 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -127,6 +127,5 @@ jobs: name: Install helm - run: | helm version - ls - ls $GITHUB_WORKSPACE + helm upgrade --install notifynl-api notifynl-api/ -n ${{ secrets.K8S_NAMESPACE }} --reuse-values --set dockerTagOverride=${{ needs.docker-build-and-push.outputs.tag }} name: Deploy chart From 8f1930f9752a06b79cbee27db734977f151bc8b6 Mon Sep 17 00:00:00 2001 From: pgaetani Date: Thu, 12 Dec 2024 15:35:05 +0100 Subject: [PATCH 26/28] merge file --- .github/workflows/merge.yaml | 81 +++++++++++++++++++++++++++++++++--- .github/workflows/pr.yaml | 5 ++- 2 files changed, 80 insertions(+), 6 deletions(-) diff --git a/.github/workflows/merge.yaml b/.github/workflows/merge.yaml index ec3d645964..c2ae1d29b6 100644 --- a/.github/workflows/merge.yaml +++ b/.github/workflows/merge.yaml @@ -7,7 +7,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - # Don't want the tests running in parallel + # Don't want multiple builds running in parallel cancel-in-progress: true jobs: @@ -17,34 +17,105 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set TAG - run: echo "TAG=$(date +%Y%m%d).${{ github.run_number }}" >> $GITHUB_ENV + - run: echo "TAG=$(date +%Y%m%d).${{ github.run_number }}" >> $GITHUB_ENV + name: Set tag + id: set-tag - - name: Generate version.py before building image - run: | + - run: | echo -e "__git_commit__ = \"${{ github.sha }}\"\n__time__ = \"$(date)\"\n__version__ = \"${{ env.TAG }}\"" > ./app/version.py + name: Generate version.py before building image - uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + name: Login at dockerhub - uses: docker/setup-qemu-action@v3 + name: Setup QEMU - uses: docker/setup-buildx-action@v3 + name: Setup buildx - uses: docker/build-push-action@v6 with: file: docker/Dockerfile push: true tags: worthnl/notifynl-api:latest,worthnl/notifynl-api:${{ env.TAG }} + name: Docker build and push ${{ env.TAG }} - uses: mathieudutour/github-tag-action@v6.2 with: github_token: ${{ secrets.GITHUB_TOKEN }} custom_tag: ${{ env.TAG }} + name: Create git tag - uses: softprops/action-gh-release@v2 with: tag_name: ${{ env.TAG }} make_latest: true + name: Create Github release + + outputs: + tag: ${{ steps.set-tag.outputs.tag }} + + helm-chart-bump: + runs-on: ubuntu-latest + needs: docker-build-and-push + + steps: + - uses: actions/checkout@v4 + with: + repository: Worth-NL/notifynl-charts-private + ref: main + token: ${{ secrets.WORTHNL_PAT }} + name: Checkout Worth-NL/notifynl-charts-private + + - uses: pietrobolcato/action-read-yaml@1.0.0 + with: + config: notifynl-api/Chart.yaml + name: Read Chart.yaml + id: yaml-read + + - uses: olegsu/semver-action@v1 + with: + version: ${{ steps.yaml-read.outputs['version'] }} + name: Chart version bump + id: version-bump + + - uses: rmeneely/update-yaml@v1 + with: + infile: notifynl-api/Chart.yaml + varlist: version=${{ steps.version-bump.outputs.version }},appVersion=${{ needs.docker-build-and-push.outputs.tag }} + name: Update Chart.yaml + + - uses: offensive-vk/auto-commit-push@v7 + with: + message: 🤖 notifynl-api chart bump + github-token: ${{ secrets.WORTHNL_PAT }} + + helm-release: + runs-on: ubuntu-latest + needs: helm-chart-bump + environment: Test + + steps: + - uses: actions/checkout@v4 + with: + repository: Worth-NL/notifynl-charts-private + ref: main + token: ${{ secrets.WORTHNL_PAT }} + name: Checkout Worth-NL/notifynl-charts-private + + - run: | + mkdir -p $HOME/.kube + echo "${{ secrets.K8S_CONFIG }}" > $HOME/.kube/config + name: Setup kubernetes config + + - uses: azure/setup-helm@v4 + name: Install helm + + - run: | + helm version + helm upgrade --install notifynl-api notifynl-api/ -n ${{ secrets.K8S_NAMESPACE }} --reuse-values --set dockerTagOverride=${{ needs.docker-build-and-push.outputs.tag }} --wait + name: Deploy chart diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index e9dac31d8c..cd6b1f90f9 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -119,13 +119,16 @@ jobs: ref: main token: ${{ secrets.WORTHNL_PAT }} name: Checkout Worth-NL/notifynl-charts-private + - run: | mkdir -p $HOME/.kube echo "${{ secrets.K8S_CONFIG }}" > $HOME/.kube/config name: Setup kubernetes config + - uses: azure/setup-helm@v4 name: Install helm + - run: | helm version - helm upgrade --install notifynl-api notifynl-api/ -n ${{ secrets.K8S_NAMESPACE }} --reuse-values --set dockerTagOverride=${{ needs.docker-build-and-push.outputs.tag }} + helm upgrade --install notifynl-api notifynl-api/ -n ${{ secrets.K8S_NAMESPACE }} --reuse-values --set dockerTagOverride=${{ needs.docker-build-and-push.outputs.tag }} --wait name: Deploy chart From ab905c5d6589d119231b987a9fff5fdea80fc982 Mon Sep 17 00:00:00 2001 From: pgaetani Date: Fri, 13 Dec 2024 10:08:55 +0100 Subject: [PATCH 27/28] better k8s tooling --- .github/workflows/pr.yaml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index cd6b1f90f9..2dc811db70 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -120,13 +120,9 @@ jobs: token: ${{ secrets.WORTHNL_PAT }} name: Checkout Worth-NL/notifynl-charts-private - - run: | - mkdir -p $HOME/.kube - echo "${{ secrets.K8S_CONFIG }}" > $HOME/.kube/config - name: Setup kubernetes config - - - uses: azure/setup-helm@v4 - name: Install helm + - uses: bwvolleyball/k8s-toolkit@v1.0.0 + with: + config: ${{ secrets.K8S_CONFIG }} - run: | helm version From f9a85b1a95b9608da50690f1b25b9962ea1d2a41 Mon Sep 17 00:00:00 2001 From: pgaetani Date: Fri, 13 Dec 2024 11:14:30 +0100 Subject: [PATCH 28/28] ruff upgrade --- .pre-commit-config.yaml | 2 +- requirements_for_test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3bfaf3bea9..3eddef6625 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ repos: - id: check-yaml - id: debug-statements - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: 'v0.0.275' + rev: 'v0.8.3' hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/requirements_for_test.txt b/requirements_for_test.txt index bcc0a80314..ade9e97220 100644 --- a/requirements_for_test.txt +++ b/requirements_for_test.txt @@ -1,6 +1,6 @@ -r requirements.txt black==24.10.0 # Also update `.pre-commit-config.yaml` if this changes -ruff==0.0.275 # Also update `.pre-commit-config.yaml` if this changes +ruff==0.8.3 # Also update `.pre-commit-config.yaml` if this changes flaky==3.7.0 moto==4.0.11