Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
9d735ffa
Unverified
Commit
9d735ffa
authored
8 years ago
by
Cam Saül
Browse files
Options
Downloads
Patches
Plain Diff
Add extra logging for DB setup during launch
parent
db6108b5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/metabase/db.clj
+6
-0
6 additions, 0 deletions
src/metabase/db.clj
with
6 additions
and
0 deletions
src/metabase/db.clj
+
6
−
0
View file @
9d735ffa
...
...
@@ -156,8 +156,11 @@
Running `.update` directly doesn't seem to work as we'd expect; it ends up commiting the changes made and they can't be rolled back at
the end of the transaction block. Converting the migration to SQL string and running that via `jdbc/execute!` seems to do the trick."
[
conn,
^
Liquibase
liquibase
]
(
log/info
"Checking if Database has unran migrations..."
)
(
when
(
has-unran-migrations?
liquibase
)
(
log/info
"Database has unran migrations. Waiting for migration lock to be cleared..."
)
(
wait-for-migration-lock-to-be-cleared
liquibase
)
(
log/info
"Migration lock is cleared. Running migrations..."
)
(
doseq
[
line
(
migrations-lines
liquibase
)]
(
jdbc/execute!
conn
[
line
]))))
...
...
@@ -214,8 +217,10 @@
;; Disable auto-commit. This should already be off but set it just to be safe
(
.setAutoCommit
(
jdbc/get-connection
conn
)
false
)
;; Set up liquibase and let it do its thing
(
log/info
"Setting up Liquibase..."
)
(
try
(
let
[
liquibase
(
conn->liquibase
conn
)]
(
log/info
"Liquibase is ready."
)
(
case
direction
:up
(
migrate-up-if-needed!
conn
liquibase
)
:force
(
force-migrate-up-if-needed!
conn
liquibase
)
...
...
@@ -339,6 +344,7 @@
(
reset!
setup-db-has-been-called?
true
)
(
verify-db-connection
(
:type
db-details
)
db-details
)
(
log/info
"Running Database Migrations..."
)
;; Run through our DB migration process and make sure DB is fully prepared
(
if
auto-migrate
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment