--
-- Licensed to JumpMind Inc under one or more contributor
-- license agreements.  See the NOTICE file distributed
-- with this work for additional information regarding
-- copyright ownership.  JumpMind Inc licenses this file
-- to you under the GNU General Public License, version 3.0 (GPLv3)
-- (the "License"); you may not use this file except in compliance
-- with the License.
--
-- You should have received a copy of the GNU General Public License,
-- version 3.0 (GPLv3) along with this library; if not, see
-- <http://www.gnu.org/licenses/>.
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied.  See the License for the
-- specific language governing permissions and limitations
-- under the License.
--

------------------------------------------------------------------------------
-- Sample Data
------------------------------------------------------------------------------
-- insert into item (item_id, name) values (11000001, 'Yummy Gum');
-- insert into item_selling_price (item_id, cloud_id, price, cost) values (11000001, '001',0.20, 0.10);
-- insert into item_selling_price (item_id, cloud_id, price, cost) values (11000001, '002',0.30, 0.20);

-- insert into sale_transaction (tran_id, store_id, workstation, day, seq) 
-- values (900, '001', '3', '2012-12-01', 90);
-- insert into sale_return_line_item (tran_id, item_id, price, quantity, returned_quantity)
-- values (900, 11000001, 0.20, 1, 0);

------------------------------------------------------------------------------
-- Sample Symmetric Configuration
------------------------------------------------------------------------------

delete from sym_trigger_router;
delete from sym_trigger;
delete from sym_router;
delete from sym_channel where channel_id in ('orders', 'order_items');
delete from sym_node_group_link;
delete from sym_node_group;
delete from sym_node_host;
delete from sym_node_identity;
delete from sym_node_security;
delete from sym_node;


# Create Channels for logically grouped tables
	# For Initial Data Faster by bulk
    update sym_channel set data_loader_type='mysql_bulk', max_batch_size=100000, max_data_to_route=100000
     where channel_id = 'reload';

	insert into sym_channel 
	(channel_id, processing_order, max_batch_size, enabled, description)
	values('setting', 1, 100000, 1, 'All Settings');

	insert into sym_channel 
	(channel_id, processing_order, max_batch_size, enabled, description)
	values('dining', 1, 100000, 1, 'sale_transactional data from register and back office');

	insert into sym_channel 
	(channel_id, processing_order, max_batch_size, enabled, description)
	values('commission', 1, 100000, 1, 'Commission ,Commissioners ,Products and Promotion');

	insert into sym_channel 
	(channel_id, processing_order, max_batch_size, enabled, description)
	values('menu', 1, 100000, 1, 'Item and pricing data');

	insert into sym_channel 
	(channel_id, processing_order, max_batch_size, enabled, description)
	values('order', 1, 100000, 1, 'Item and pricing data');

	insert into sym_channel 
	(channel_id, processing_order, max_batch_size, enabled, description)
	values('sale', 1, 100000, 1, 'Sale data');

	insert into sym_channel 
	(channel_id, processing_order, max_batch_size, enabled, description)
	values('oqs', 1, 100000, 1, 'OQS and cashier temenal');

# Create Node Groups and Links
	insert into sym_node_group (node_group_id) values ('sx');
	insert into sym_node_group (node_group_id) values ('cloud');

	insert into sym_node_group_link (source_node_group_id, target_node_group_id, data_event_action) values ('sx', 'cloud', 'W');
	insert into sym_node_group_link (source_node_group_id, target_node_group_id, data_event_action) values ('cloud', 'sx', 'P');

# Create Trigger for Setting Channel 
	
	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('seed_generators','seed_generators','setting',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('lookups','lookups','setting',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('membership_actions','membership_actions','setting',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('membership_settings','membership_settings','setting',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('payment_method_settings','payment_method_settings','setting',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('print_settings','print_settings','setting',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('shops','shops','setting',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('customers','customers','setting',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('tax_profiles','customers','setting',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('display_images','customers','setting',current_timestamp,current_timestamp);

# Create Trigger for Dining Channel 

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('zones','zones','dining',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('dining_charges','dining_charges','dining',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('dining_facilities','dining_facilities','dining',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('dining_queues','dining_queues','dining',current_timestamp,current_timestamp);

# Create Trigger for Commission Channel 
	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('commissioners','commissioners','commission',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('commissions','commissions','commission',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('employees','employees','commission',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('in_duties','in_duties','commission',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('inventory_definitions','inventory_definitions','commission',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('product_commissions','product_commissions','commission',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('products','products','commission',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('promotion_products','promotion_products','commission',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('promotions','promotions','commission',current_timestamp,current_timestamp);

# Create Trigger for Menu Channel 
	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('accounts','accounts','menu',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('menu_item_attributes','menu_item_attributes','menu',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('menu_item_options','menu_item_options','menu',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('menus','menus','menu',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('menu_categories','menu_categories','menu',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('menu_items','menu_items','menu',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('menu_item_instances','menu_item_instances','menu',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('item_sets','item_sets','menu',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('menu_item_sets','menu_item_sets','menu',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('menu_instance_item_sets','menu_instance_item_sets','menu',current_timestamp,current_timestamp);

# Create Trigger for Order Channel 
	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('orders','orders','order',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('order_items','order_items','order',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('bookings','bookings','order',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('booking_orders','booking_orders','order',current_timestamp,current_timestamp);

# Create Trigger for Sale Channel 
	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('sales','sales','sale',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('sale_items','sale_items','sale',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('sale_audits','sale_audits','sale',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('sale_orders','sale_orders','sale',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('sale_payments','sale_payments','sale',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('sale_taxes','sale_taxes','sale',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('payment_journals','payment_journals','sale',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('shift_sales','shift_sales','sale',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('stock_check_items','stock_check_items','sale',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('stock_checks','stock_checks','sale',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('stock_journals','stock_journals','sale',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('surveys','surveys','sale',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('card_sale_trans','card_sale_trans','sale',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('card_settle_trans','card_settle_trans','sale',current_timestamp,current_timestamp);

# Create Trigger for OQS Channel 

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('assigned_order_items','assigned_order_items','oqs',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('cashier_terminals','cashier_terminals','oqs',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('cashier_terminal_by_zones','cashier_terminal_by_zones','oqs',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('cashier_login_logs','cashier_login_logs','oqs',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('order_queue_process_by_zones','order_queue_process_by_zones','oqs',current_timestamp,current_timestamp);

	insert into sym_trigger 
	(trigger_id,source_table_name,channel_id,last_update_time,create_time)
	values('order_queue_stations','order_queue_stations','oqs',current_timestamp,current_timestamp);


# Create Routers for Nodes
	insert into sym_router 
	(router_id,source_node_group_id,target_node_group_id,router_type,create_time,last_update_time)
	values('sx_2_cloud', 'sx', 'cloud', 'default',current_timestamp, current_timestamp);

	insert into sym_router 
	(router_id,source_node_group_id,target_node_group_id,router_type,sync_on_delete,create_time,last_update_time)
	values('cloud_2_sx', 'cloud', 'sx', 'default',0,current_timestamp, current_timestamp);

-- insert into sym_router 
-- (router_id,source_node_group_id,target_node_group_id,router_type,router_expression,create_time,last_update_time)
-- values('sx_2_one_cloud', 'sx', 'cloud', 'column','cloud_ID=:EXTERNAL_ID or OLD_cloud_ID=:EXTERNAL_ID',current_timestamp, current_timestamp);


# Add triggers for tables with router

# Setting Channel # From cloud to Master

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('seed_generators','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('lookups','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('membership_actions','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('membership_settings','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('payment_method_settings','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('print_settings','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('shops','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('customers','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('tax_profiles','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('display_images','cloud_2_sx', 100, current_timestamp, current_timestamp);

# Setting Channel # From Master to cloud

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('seed_generators','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('lookups','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('membership_actions','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('membership_settings','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('payment_method_settings','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('print_settings','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('shops','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('customers','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('tax_profiles','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('display_images','sx_2_cloud', 100, current_timestamp, current_timestamp);

#End Setting Channel

# Dining Channel # From cloud to SX
	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('zones','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('dining_charges','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('dining_facilities','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('dining_queues','cloud_2_sx', 100, current_timestamp, current_timestamp);

# Dining Channel # From SX to cloud
	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('zones','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('dining_charges','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('dining_facilities','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('dining_queues','sx_2_cloud', 100, current_timestamp, current_timestamp);

#end Dining Channel

# Commission/Promotion/Product Channel # From cloud to SX
	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('commissioners','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('commissions','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('employees','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('in_duties','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('inventory_definitions','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('product_commissions','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('products','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('promotion_products','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('promotions','cloud_2_sx', 100, current_timestamp, current_timestamp);

# Commission/Promotion/Product Channel # From SX to cloud
	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('commissioners','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('commissions','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('employees','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('in_duties','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('inventory_definitions','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('product_commissions','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('products','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('promotion_products','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('promotions','sx_2_cloud', 100, current_timestamp, current_timestamp);

#end Commission/Promotion/Product Channel

# Menu Channel # From cloud to SX
	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('accounts','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('menu_item_attributes','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('menu_item_options','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('menus','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('menu_categories','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('menu_items','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('menu_item_instances','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('item_sets','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('menu_item_sets','cloud_2_sx', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('menu_instance_item_sets','cloud_2_sx', 100, current_timestamp, current_timestamp);

# Menu Channel # From SX to cloud
	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('accounts','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('menu_item_attributes','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('menu_item_options','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('menus','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('menu_categories','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('menu_items','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('menu_item_instances','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('item_sets','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('menu_item_sets','sx_2_cloud', 100, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('menu_instance_item_sets','sx_2_cloud', 100, current_timestamp, current_timestamp);
#End Menu Channel

# Order Channel # From cloud to Sx
	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('orders','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('order_items','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('bookings','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('booking_orders','cloud_2_sx', 200, current_timestamp, current_timestamp);

# Order Channel # From SX to cloud
	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('orders','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('order_items','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('bookings','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('booking_orders','sx_2_cloud', 200, current_timestamp, current_timestamp);
# End Order Channel 

# Sale Channel # From cloud to Sx
	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('sales','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('sale_items','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('sale_audits','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('sale_orders','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('sale_payments','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('sale_taxes','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('payment_journals','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('shift_sales','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('stock_check_items','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('stock_checks','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('stock_journals','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('surveys','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('card_sale_trans','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('card_settle_trans','cloud_2_sx', 200, current_timestamp, current_timestamp);

# Sale Channel # From SX to cloud
	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('sales','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('sale_items','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('sale_audits','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('sale_orders','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('sale_payments','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('sale_taxes','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('payment_journals','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('shift_sales','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('stock_check_items','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('stock_checks','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('stock_journals','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('surveys','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('card_sale_trans','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('card_settle_trans','sx_2_cloud', 200, current_timestamp, current_timestamp);

# End Sale Channel 

# Oqs Channel # From cloud to Sx
	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('assigned_order_items','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('cashier_terminals','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('cashier_terminal_by_zones','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('cashier_login_logs','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('order_queue_process_by_zones','cloud_2_sx', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('order_queue_stations','cloud_2_sx', 200, current_timestamp, current_timestamp);

# Oqs Channel # From SX to cloud
	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('assigned_order_items','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('cashier_terminals','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('cashier_terminal_by_zones','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('cashier_login_logs','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('order_queue_process_by_zones','sx_2_cloud', 200, current_timestamp, current_timestamp);

	insert into sym_trigger_router 
	(trigger_id,router_id,initial_load_order,last_update_time,create_time)
	values('order_queue_stations','sx_2_cloud', 200, current_timestamp, current_timestamp);
# End Oqs Channel


insert into sym_node (node_id,node_group_id,external_id,sync_enabled,sync_url,schema_version,symmetric_version,database_type,database_version,heartbeat_time,timezone_offset,batch_to_send_count,batch_in_error_count,created_at_node_id) 
 values ('000','sx','000',1,null,null,null,null,null,current_timestamp,null,0,0,'000');
insert into sym_node (node_id,node_group_id,external_id,sync_enabled,sync_url,schema_version,symmetric_version,database_type,database_version,heartbeat_time,timezone_offset,batch_to_send_count,batch_in_error_count,created_at_node_id) 
 values ('001','cloud','001',1,null,null,null,null,null,current_timestamp,null,0,0,'000');
-- insert into sym_node (node_id,node_group_id,external_id,sync_enabled,sync_url,schema_version,symmetric_version,database_type,database_version,heartbeat_time,timezone_offset,batch_to_send_count,batch_in_error_count,created_at_node_id) 
--  values ('002','cloud','002',1,null,null,null,null,null,current_timestamp,null,0,0,'000');


insert into sym_node_security (node_id,node_password,registration_enabled,registration_time,initial_load_enabled,initial_load_time,created_at_node_id) 
 values ('000','acd36ce830d1fda466eec921433f38',0,current_timestamp,1,current_timestamp,'000');
insert into sym_node_security (node_id,node_password,registration_enabled,registration_time,initial_load_enabled,initial_load_time,created_at_node_id) 
 values ('001','acd36ce830d1fda466eec921433f38',1,null,1,null,'000');
-- insert into sym_node_security (node_id,node_password,registration_enabled,registration_time,initial_load_enabled,initial_load_time,created_at_node_id) 
--  values ('002','acd36ce830d1fda466eec921433f38',1,null,1,null,'000');

insert into sym_node_identity values ('000');
