<commit_before>var config = require('./config/config');
var pg = require('pg');

const Client = pg.Client;

const client = new Client(config.getDBConfig());
client.connect();

var sync_table_list = config.getSyncTableList();
var trigger_actions = ["insert", "update", "delete"];

sync_table_list.forEach(function (table) {
    trigger_actions.forEach(function (trigger) {
        var trigger_name = table + '_notify_' + trigger;
        var drop_trigger_sql = "DROP TRIGGER " + trigger_name + " ON " + table;
        //var drop_trigger_sql = "DROP TRIGGER IF EXISTS " + trigger_name + " ON " + table;
        var create_trigger_sql = "CREATE TRIGGER " + trigger_name + " AFTER " + trigger + " ON " + table + " FOR EACH ROW EXECUTE PROCEDURE table_update_notify()";
        client.query(drop_trigger_sql, function (err, res) {
            if (err) {
                console.log(err.stack);
            } else {
                console.log(trigger_name + " dropped");
                client.query(create_trigger_sql, function (err, res) {
                    if (err) {
                        console.log(err.stack);
                    } else {
                        console.log(trigger_name + " created");
                    }
                });
            }
        });<commit_msg>config updated<commit_after>var config = require('./config/config');
var pg = require('pg');

const Client = pg.Client;

const client = new Client(config.getDBConfig());
client.connect();

var sync_table_list = config.getSyncTableList();
var trigger_actions = ["insert", "update", "delete"];

sync_table_list.forEach(function (table) {
    trigger_actions.forEach(function (trigger) {
        var trigger_name = table + '_notify_' + trigger;
        var drop_trigger_sql = "DROP TRIGGER IF EXISTS " + trigger_name + " ON " + table;
        var create_trigger_sql = "CREATE TRIGGER " + trigger_name + " AFTER " + trigger + " ON " + table + " FOR EACH ROW EXECUTE PROCEDURE table_update_notify()";
        client.query(drop_trigger_sql, function (err, res) {
            if (err) {
                console.log(err.stack);
            } else {
                console.log(trigger_name + " dropped");
                client.query(create_trigger_sql, function (err, res) {
                    if (err) {
                        console.log(err.stack);
                    } else {
                        console.log(trigger_name + " created");
                    }
                });
            }
        });
{'fraction_non_alphanumeric': 0.12304609218436874, 'fraction_numerical': 0.0, 'mean_word_length': 2.0663390663390664, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1239580', 'n_tokens_mistral': 712, 'n_tokens_neox': 687, 'n_words': 158}