FAZuH / faz-bot

Wynncraft utility and statistics discord bot.
MIT License
1 stars 0 forks source link

refactor: rename fazbot to fazcord #6

Closed FAZuH closed 2 months ago

FAZuH commented 2 months ago
FAZuH commented 2 months ago

Decided to rename now while repository is still in development. Once I make sure everything works, I'll post a database migration script here.

FAZuH commented 2 months ago

Database Migration Steps

  1. Disable fazbot docker service
  2. Connect into mysql service with bash using make sql act=bash
  3. Paste and run the command below. Replace -p<password> with your own password
mariadb -u root -ppassword -e "CREATE DATABASE IF NOT EXISTS \`faz-cord\`; CREATE DATABASE IF NOT EXISTS \`faz-cord_test\`; GRANT ALL PRIVILEGES ON \`faz-cord\`.* TO 'faz'@'%'; GRANT ALL PRIVILEGES ON \`faz-cord_test\`.* TO 'faz'@'%'; FLUSH PRIVILEGES;"

mariadb -u root -ppassword -sNe 'show tables' faz-bot | while read table; do 
    mariadb -u root -ppassword -sNe "RENAME TABLE \`faz-bot\`.\`$table\` TO \`faz-cord\`.\`$table\`"; 
done

mariadb -u root -ppassword -sNe 'show tables' faz-bot_test | while read table; do 
    mariadb -u root -ppassword -sNe "RENAME TABLE \`faz-bot_test\`.\`$table\` TO \`faz-cord_test\`.\`$table\`"; 
done

Also make sure you update your .env file to match .env-example