Skip to content

Commit

Permalink
add example of bi-directional sync
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Sep 23, 2008
1 parent f9bac92 commit e474313
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions symmetric/src/main/deploy/samples/create_sample.xml
Expand Up @@ -31,6 +31,7 @@
<column name="item_id" type="INTEGER" required="true" />
<column name="price" type="DECIMAL" size="10,2" required="true" />
<column name="quantity" type="INTEGER" required="true" />
<column name="returned_quantity" type="INTEGER"/>
<foreign-key name="fk_srli_tran_id" foreignTable="sale_transaction">
<reference local="tran_id" foreign="tran_id" />
</foreign-key>
Expand Down
11 changes: 8 additions & 3 deletions symmetric/src/main/deploy/samples/insert_sample.sql
Expand Up @@ -6,8 +6,8 @@ insert into item (item_id, price_id, name) values (11000001, 1, 'Yummy Gum');

insert into sale_transaction (tran_id, store, workstation, day, seq)
values (900, '1', '3', '2007-11-01', 90);
insert into sale_return_line_item (tran_id, item_id, price, quantity)
values (900, 11000001, 0.10, 1);
insert into sale_return_line_item (tran_id, item_id, price, quantity, returned_quantity)
values (900, 11000001, 0.10, 1, 0);

------------------------------------------------------------------------------
-- Sample Symmetric Configuration
Expand All @@ -26,7 +26,7 @@ insert into sym_node_group_link (source_node_group_id, target_node_group_id, dat
values ('corp', 'store', 'W');

insert into sym_node (node_id, node_group_id, external_id, sync_enabled, symmetric_version)
values ('00000', 'corp', '00000', 1, '1.3.0');
values ('00000', 'corp', '00000', 1, '1.4.0');
insert into sym_node_identity values ('00000');

--
Expand Down Expand Up @@ -58,3 +58,8 @@ values('sale_transaction', 'store', 'corp', 'sale_transaction', 1, 1, 1, 200, 'd
insert into sym_trigger
(source_table_name, source_node_group_id, target_node_group_id, channel_id, sync_on_insert, sync_on_update, sync_on_delete, initial_load_order, last_updated_by, last_updated_time, create_time)
values('sale_return_line_item', 'store', 'corp', 'sale_transaction', 1, 1, 1, 205, 'demo', current_timestamp, current_timestamp);

-- Example of using sync_on_incoming_batch to sync a change arriving at corp from one store back out to all stores
insert into sym_trigger
(source_table_name, source_node_group_id, target_node_group_id, channel_id, sync_on_insert, sync_on_update, sync_on_delete, sync_on_incoming_batch, initial_load_order, last_updated_by, last_updated_time, create_time)
values('sale_return_line_item', 'corp', 'store', 'sale_transaction', 1, 1, 1, 1, 205, 'demo', current_timestamp, current_timestamp);

0 comments on commit e474313

Please sign in to comment.