Skip to content
Snippets Groups Projects
Unverified Commit 11c1bbaf authored by bryan's avatar bryan Committed by GitHub
Browse files

Add app db as audit db on app startup (#30305)

* add column for marking the audit database

* create audit db on app startup

On app startup, in enterprise mode, always check that there is an
up-to-date audit database with is_audit set to true. up-to-date means
that it matches the app-db. If the audit db doesnt exist, or doesn't match up with
the app-db, it will be created. otherwise no-op

- refactor GET /api/database/ into defendpoint

* add a few tests

* add more tests + return kw for no-op

* Merge branch 'master' into bcm-add-app-db-as-audit-db

* fix migrations file

* lint fix + remove def

* keep the old audit db around

- nil -> ::no-op

* small macro fix

* Merge branch 'master' into bcm-add-app-db-as-audit-db

* Merge branch 'master' into bcm-add-app-db-as-audit-db

* move ensure-db-exists! into its own namespace

- avoids circlar dependency on app startup

* fix tests

* lint fix

* inspect test values

* use mdb.env/env to initialize audit db

* try returning the app-db connection pool

- instead of making a doppelganger in metabase database

* get the is_audit column when looking up dbs in qp

- this key is needed to return the appdb for the "Audit DB"'s connection

* clean up audit-db install/update/noop logic

* remove audit db from GET api/database/

* Merge branch 'master' of github.com:metabase/metabase into bcm-add-app-db-as-audit-db

* fix linter + inline extra function

* fix a test

* Merge branch 'master' into bcm-add-app-db-as-audit-db

* don't test actions on audit db :cry:

* Revert "don't test actions on audit db :cry:"

This reverts commit 581ed1ab9495de7b46bccb8b1ab19f66a8fd106d.

* for tests to work low IDs are basically reserved

- use a higher id when installing audit db

* use defenterprise for ensure-audit-db-installed!

* Merge branch 'master' into bcm-add-app-db-as-audit-db
parent fd8158f2
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment