Skip to content

Commit

Permalink
Merge pull request #4 from ABCurado/master
Browse files Browse the repository at this point in the history
Fixing merge and sync type
  • Loading branch information
pelgrim authored May 26, 2017
2 parents 2433934 + cac7a15 commit 7bbcbe4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Ubuntu-based Bucardo image for Docker Containers.
},{
"sources": [1,2],
"targets": [3],
"tables": "product, order",
"tables": "product,order",
"onetimecopy": 0
}
]
Expand All @@ -70,7 +70,7 @@ Ubuntu-based Bucardo image for Docker Containers.

* The other attribute required is the syncs' *table lists*. A *table list* is a String containing the tables sync'd by that sync, separated by a comma and a space, as in the example above.

* [Onetimecopy](https://bucardo.org/wiki/Onetimecopy) is used describe if a full table copy is required:
* [Onetimecopy](https://bucardo.org/wiki/Onetimecopy) is used for full table copy:
- 0 No full copy is done
- 1 A full table copy is always performed
- 2 A full copy is done in case the destination table is empty
Expand Down
2 changes: 1 addition & 1 deletion example/bucardo.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},{
"sources": [1,2],
"targets": [0],
"tables": "product, order",
"tables": "product,order",
"onetimecopy": 0
}
]
Expand Down
8 changes: 4 additions & 4 deletions lib/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ db_sync_entities() {
local db_index=0
local sync_entity

sync_entity=$(sync_attr $sync_index $entity"s[$db_index]" integer)
sync_entity=$(sync_attr $sync_index $entity"s[$db_index]" string)
while [[ "$sync_entity" != null ]]; do
[[ "$DB_STRING" != "" ]] && DB_STRING="$DB_STRING,"
DB_STRING=$DB_STRING"db"$sync_entity":$entity"
db_index=$(expr $db_index + 1)
sync_entity=$(sync_attr $sync_index $entity"s[$db_index]" integer)
sync_entity=$(sync_attr $sync_index $entity"s[$db_index]" string)
done
}

Expand All @@ -160,7 +160,7 @@ add_syncs_to_bucardo() {
run_bucardo_command "del sync sync$sync_index"
run_bucardo_command "add sync sync$sync_index \
dbs=$DB_STRING \
tables=$(sync_attr $sync_index tables) \
tables=$(sync_attr $sync_index tables list) \
onetimecopy=$one_time_copy"
sync_index=$(expr $sync_index + 1)
done
Expand Down Expand Up @@ -189,4 +189,4 @@ main() {
#bucardo_status
}

main
main

0 comments on commit 7bbcbe4

Please sign in to comment.