Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GoGoCarto
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pixel Humain
GoGoCarto
Commits
376434e0
Unverified
Commit
376434e0
authored
5 years ago
by
Sebastian Castro
Browse files
Options
Downloads
Patches
Plain Diff
Fixs TileLayer migrations
parent
3f639273
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mongo_operations
+1
-1
1 addition, 1 deletion
mongo_operations
src/Biopen/CoreBundle/Command/MigrationCommand.php
+10
-10
10 additions, 10 deletions
src/Biopen/CoreBundle/Command/MigrationCommand.php
with
11 additions
and
11 deletions
mongo_operations
+
1
−
1
View file @
376434e0
...
@@ -111,4 +111,4 @@ db.Configuration.updateMany( { } , { $set: { 'defautTileLayer': DBRef("TileLayer
...
@@ -111,4 +111,4 @@ db.Configuration.updateMany( { } , { $set: { 'defautTileLayer': DBRef("TileLayer
// Reset duplicates
// Reset duplicates
db.Element.updateMany({moderationState: 4}, {$set: {moderationState: 0, isDuplicateNode: false}, $unset: { potentialDuplicates: 1} })
db.Element.updateMany({moderationState: 4}, {$set: {moderationState: 0, isDuplicateNode: false}, $unset: { potentialDuplicates: 1} })
db.MigrationState.updateMany({}, { $set: { migrationsIndex: 0}})
db.MigrationState.updateMany({}, { $set: { migrationIndex: 0}})
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/Biopen/CoreBundle/Command/MigrationCommand.php
+
10
−
10
View file @
376434e0
...
@@ -20,12 +20,12 @@ class MigrationCommand extends GoGoAbstractCommand
...
@@ -20,12 +20,12 @@ class MigrationCommand extends GoGoAbstractCommand
// -----------------------------------------------------------------
// -----------------------------------------------------------------
public
$migrations
=
[
public
$migrations
=
[
// v2.4.6
// v2.4.6
"
db.TileLayer.updateMany(
{
'
name
':'
cartodb
'
}
, {
\
$set: {
'
attribution
':'
© <a href=\
'
http://www.openstreetmap.org/copyright\
'
>OpenStreetMap</a> © <a href=\
'
http://cartodb.com/attributions\
'
>CartoDB</a>
'
}})
"
,
'
db.TileLayer.updateMany({name
:"
cartodb
"
}, {$set: {attribution
:"
© <a href=\
"
http://www.openstreetmap.org/copyright\
"
>OpenStreetMap</a> © <a href=\
"
http://cartodb.com/attributions\
"
>CartoDB</a>
"
}})
'
,
"
db.TileLayer.updateMany(
{
'
name
':'
hydda
'
}
, {
\
$set: {
'
attribution
':'
Tiles courtesy of <a href=\
'
http://openstreetmap.se/\
'
target=\
'
_blank\
'
>OpenStreetMap Sweden</a> — Map data © <a href=\
'
http://www.openstreetmap.org/copyright\
'
>OpenStreetMap</a>
'
}})
"
,
'
db.TileLayer.updateMany({name
:"
hydda
"
}, {$set: {attribution
:"
Tiles courtesy of <a href=\
"
http://openstreetmap.se/\
"
target=\
"
_blank\
"
>OpenStreetMap Sweden</a> — Map data © <a href=\
"
http://www.openstreetmap.org/copyright\
"
>OpenStreetMap</a>
"
}})
'
,
"
db.TileLayer.updateMany(
{
'
name
':'
wikimedia
'
}
, {
\
$set: {
'
attribution
':'
<a href=\
'
https://wikimediafoundation.org/wiki/Maps_Terms_of_Use\
'
>Wikimedia</a> | Map data © <a href=\
'
https://www.openstreetmap.org/copyright\
'
>OpenStreetMap contributors</a>
'
}})
"
,
'
db.TileLayer.updateMany({name
:"
wikimedia
"
}, {$set: {attribution
:"
<a href=\
"
https://wikimediafoundation.org/wiki/Maps_Terms_of_Use\
"
>Wikimedia</a> | Map data © <a href=\
"
https://www.openstreetmap.org/copyright\
"
>OpenStreetMap contributors</a>
"
}})
'
,
"
db.TileLayer.updateMany(
{
'
name
':'
lyrk
'
}
, {
\
$set: {
'
attribution
':'
© Lyrk | Map data © <a href=\
'
http://www.openstreetmap.org/copyright\
'
>OpenStreetMap</a>
'
}})
"
,
'
db.TileLayer.updateMany({name
:"
lyrk
"
}, {$set: {attribution
:"
© Lyrk | Map data © <a href=\
"
http://www.openstreetmap.org/copyright\
"
>OpenStreetMap</a>
"
}})
'
,
"
db.TileLayer.updateMany(
{
'
name
':'
osmfr
'
}
, {
\
$set: {
'
attribution
':'
© Openstreetmap France | © <a href=\
'
http://www.openstreetmap.org/copyright\
'
>OpenStreetMap</a>
'
}})
"
,
'
db.TileLayer.updateMany({name
:"
osmfr
"
}, {$set: {attribution
:"
© Openstreetmap France | © <a href=\
"
http://www.openstreetmap.org/copyright\
"
>OpenStreetMap</a>
"
}})
'
,
"
db.TileLayer.updateMany(
{
'
name
':'
stamenWaterColor
'
}
, {
\
$set: {
'
attribution
':'
Map tiles by <a href=\
'
http://stamen.com\
'
>Stamen Design</a>, <a href=\
'
http://creativecommons.org/licenses/by/3.0\
'
>CC BY 3.0</a> — Map data © <a href=\
'
http://www.openstreetmap.org/copyright\
'
>OpenStreetMap</a>
'
}})
"
,
'
db.TileLayer.updateMany({name
:"
stamenWaterColor
"
}, {$set: {attribution
:"
Map tiles by <a href=\
"
http://stamen.com\
"
>Stamen Design</a>, <a href=\
"
http://creativecommons.org/licenses/by/3.0\
"
>CC BY 3.0</a> — Map data © <a href=\
"
http://www.openstreetmap.org/copyright\
"
>OpenStreetMap</a>
"
}})
'
,
];
];
public
$commands
=
[
public
$commands
=
[
...
@@ -76,9 +76,9 @@ class MigrationCommand extends GoGoAbstractCommand
...
@@ -76,9 +76,9 @@ class MigrationCommand extends GoGoAbstractCommand
$migrationsToRun
=
array_slice
(
$this
->
migrations
,
$migrationState
->
getMigrationIndex
());
$migrationsToRun
=
array_slice
(
$this
->
migrations
,
$migrationState
->
getMigrationIndex
());
$migrationsToRun
=
array_unique
(
$migrationsToRun
);
$migrationsToRun
=
array_unique
(
$migrationsToRun
);
foreach
(
$dbs
as
$db
)
{
foreach
(
$dbs
as
$db
)
{
$this
->
log
(
"run migration on project "
.
$db
);
foreach
(
$migrationsToRun
as
$migration
)
{
foreach
(
$migrationsToRun
as
$migration
)
{
$this
->
runCommand
(
$db
,
$migration
);
$this
->
log
(
"run migration "
.
$migration
.
" on project "
.
$db
);
$this
->
runMongoCommand
(
$db
,
$migration
);
}
}
}
}
$this
->
log
(
count
(
$migrationsToRun
)
.
" migrations performed"
);
$this
->
log
(
count
(
$migrationsToRun
)
.
" migrations performed"
);
...
@@ -129,9 +129,9 @@ class MigrationCommand extends GoGoAbstractCommand
...
@@ -129,9 +129,9 @@ class MigrationCommand extends GoGoAbstractCommand
$em
->
flush
();
$em
->
flush
();
}
}
private
function
runCommand
(
$db
,
$command
)
private
function
run
Mongo
Command
(
$db
,
$command
)
{
{
$process
=
new
Process
(
"mongo
{
$db
}
--eval
\"
{
$command
}
\"
"
);
$process
=
new
Process
(
"mongo
{
$db
}
--eval
'
{
$command
}
'
"
);
return
$process
->
run
();
return
$process
->
run
();
}
}
}
}
\ No newline at end of file
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