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
6091adca
Unverified
Commit
6091adca
authored
1 year ago
by
Cam Saul
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix #34505 (#34536)
parent
e2595bca
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/metabase/cmd/copy.clj
+1
-7
1 addition, 7 deletions
src/metabase/cmd/copy.clj
src/metabase/util/jvm.clj
+4
-4
4 additions, 4 deletions
src/metabase/util/jvm.clj
with
5 additions
and
11 deletions
src/metabase/cmd/copy.clj
+
1
−
7
View file @
6091adca
...
...
@@ -4,10 +4,7 @@
data from an application database to any empty application database for all combinations of supported application
database types."
(
:require
[
clojure.java.classpath
:as
classpath
]
[
clojure.java.jdbc
:as
jdbc
]
[
clojure.string
:as
str
]
[
clojure.tools.namespace.find
:as
ns.find
]
[
honey.sql
:as
sql
]
[
metabase.config
:as
config
]
[
metabase.db.connection
:as
mdb.connection
]
...
...
@@ -375,7 +372,6 @@
table-name
table-name
)]]
(
jdbc/execute!
target-db-conn
sql
)))))
(
s/defn
copy!
"Copy data from a source application database into an empty destination application database."
[
source-db-type
:-
(
s/enum
:h2
:postgres
:mysql
)
...
...
@@ -383,9 +379,7 @@
target-db-type
:-
(
s/enum
:h2
:postgres
:mysql
)
target-data-source
:-
javax.sql.DataSource
]
;; make sure the entire system is loaded before running this test, to make sure we account for all the models.
(
doseq
[
ns-symb
(
ns.find/find-namespaces
(
classpath/system-classpath
))
:when
(
and
(
str/starts-with?
ns-symb
"metabase"
)
(
not
(
str/includes?
ns-symb
"test"
)))]
(
doseq
[
ns-symb
u/metabase-namespace-symbols
]
(
classloader/require
ns-symb
))
;; make sure the source database is up-do-date
(
step
(
trs
"Set up {0} source database and run migrations..."
(
name
source-db-type
))
...
...
This diff is collapsed.
Click to expand it.
src/metabase/util/jvm.clj
+
4
−
4
View file @
6091adca
...
...
@@ -268,11 +268,11 @@
;; This is made `^:const` so it will get calculated when the uberjar is compiled. `find-namespaces` won't work if
;; source is excluded; either way this takes a few seconds, so doing it at compile time speeds up launch as well.
(
defonce
^
:const
^
{
:doc
"Vector of symbols of all Metabase namespaces, excluding test namespaces. This is intended
for use by various routines that load related namespaces, such as task and events
initialization."
}
metabase-namespace-symbols
for use by various routines that load related namespaces, such as task and events
initialization."
}
metabase-namespace-symbols
(
vec
(
sort
(
for
[
ns-symb
(
ns.find/find-namespaces
(
classpath/system-classpath
))
:when
(
and
(
str/starts-with?
ns-symb
"metabase
.
"
)
:when
(
and
(
str/starts-with?
ns-symb
"metabase"
)
(
not
(
str/includes?
ns-symb
"test"
)))]
ns-symb
))))
...
...
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