PERMISSIONS_PLATFORM database
========

Refer to `snowflake/README.md` for basic conventions for interacting with this database. Here are some differences between PERMISSIONS_PLATFORM database and many of the others in `snowflake/`:

* PERMISSIONS_PLATFORM was created within `terraform-infra`, using the `terraform-snowflake` module. You can see this [here](https://github.com/theorchard/terraform-infra/tree/master/prod/snowflake/orchard/databases/permissions-platform), and details on how the terraform self-service works are available [here](https://www.notion.so/Snowflake-Terraform-Guide-50551b5b3fd14e83ac2610b6237f2119).
* The Jenkins CLI Deploy user that executes changes has already been assigned the `PERMISSIONS_PLATFORM_DB_PROD_SCHEMA_READWRITE` and `PERMISSIONS_PLATFORM_DB_QA_SCHEMA_READWRITE` roles.
* The `PERMISSIONS_PLATFORM_DB_PROD_SCHEMA_READWRITE` and `PERMISSIONS_PLATFORM_DB_QA_SCHEMA_READWRITE` roles have the ability to manage grants, and ensure that any new DDL items have the appropriate grants to the roles:
  - `PERMISSIONS_PLATFORM_DB_<ENV>_SCHEMA_READWRITE`
  - `PERMISSIONS_PLATFORM_DB_<ENV>_SCHEMA_READ`

**Thus, you should NOT need to assign grants via your database DDL.**
* If DDL fails to be executed in Jenkins [db-deploy-pipeline](https://pipeline.theorchard.io/job/db-deploy-pipeline/), follow up with DevOps. A new version of `terraform-snowflake` may be required, along with the corresponding module bump in `terraform-infra`.
