<commit_before>#!/usr/bin/env bash
set -e

DB_HOST="${DB_HOST:-localhost}"
DB_PORT="${DB_PORT:-5431}"
echo "Using PostgreSQL at $DB_HOST:$DB_PORT"

PSQL="psql -U brewingagile --host=$DB_HOST --port=$DB_PORT brewingagile"
PSQLI="$PSQL -t -c"

### Drop all tables
DROPSTATEMENTS=`$PSQLI "select 'drop table if exists \"' || tablename || '\" cascade;' from pg_tables where schemaname = 'public';"`
echo $DROPSTATEMENTS | while read -r line; do $PSQLI "$line"; done

ssh postgres@linode2 pg_dump -F p brewingagile | $PSQL -a -f -

$PSQLI "UPDATE registration SET participant_email = '<EMAIL>';"

#$PSQLI "INSERT INTO users(username, passwordhash, role, role_co) VALUES ('admin', '<PASSWORD>', 'ADMIN', NULL);"
<commit_msg>Set Account Billing Email to my email, just in case.<commit_after>#!/usr/bin/env bash
set -e

DB_HOST="${DB_HOST:-localhost}"
DB_PORT="${DB_PORT:-5431}"
echo "Using PostgreSQL at $DB_HOST:$DB_PORT"

PSQL="psql -U brewingagile --host=$DB_HOST --port=$DB_PORT brewingagile"
PSQLI="$PSQL -t -c"

### Drop all tables
DROPSTATEMENTS=`$PSQLI "select 'drop table if exists \"' || tablename || '\" cascade;' from pg_tables where schemaname = 'public';"`
echo $DROPSTATEMENTS | while read -r line; do $PSQLI "$line"; done

ssh postgres@linode2 pg_dump -F p brewingagile | $PSQL -a -f -

$PSQLI "UPDATE registration SET participant_email = '<EMAIL>';"
$PSQLI "UPDATE account SET billing_email = '<EMAIL>';"

#$PSQLI "INSERT INTO users(username, passwordhash, role, role_co) VALUES ('admin', '<PASSWORD>', 'ADMIN', NULL);"

{'fraction_non_alphanumeric': 0.16666666666666666, 'fraction_numerical': 0.006535947712418301, 'mean_word_length': 5.487288135593221, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '4294033', 'n_tokens_mistral': 577, 'n_tokens_neox': 549, 'n_words': 161}