Merge pull request #1062 from Icinga/remove-tools_dev_update_schema.sh
Some checks are pending
Compliance / compliance (push) Waiting to run
Build and Publish Container Image / build-and-publish-container-image (push) Waiting to run
Go / build-test (macos-latest) (push) Waiting to run
Go / build-test (ubuntu-latest) (push) Waiting to run
Go / lint (push) Waiting to run
Go / vet (push) Waiting to run
Go / fmt (push) Waiting to run
Go / modtidy (push) Waiting to run
Go / vendor-diff (push) Waiting to run
Integration Tests / MySQL (push) Waiting to run
Integration Tests / PostgreSQL (push) Waiting to run
SQL / MySQL 5.5 (push) Waiting to run
SQL / MySQL 5.6 (push) Waiting to run
SQL / MariaDB 10.1 (push) Waiting to run
SQL / MariaDB 10.2 (push) Waiting to run
SQL / MariaDB 10.3 (push) Waiting to run
SQL / MariaDB 10.4 (push) Waiting to run
SQL / MariaDB 10.5 (push) Waiting to run
SQL / MariaDB 10.6 (push) Waiting to run
SQL / MariaDB 10.7 (push) Waiting to run
SQL / MariaDB latest (push) Waiting to run
SQL / MySQL 5.7 (push) Waiting to run
SQL / MySQL 8 (push) Waiting to run
SQL / MySQL latest (push) Waiting to run
SQL / PostgreSQL 10 (push) Waiting to run
SQL / PostgreSQL 11 (push) Waiting to run
SQL / PostgreSQL 12 (push) Waiting to run
SQL / PostgreSQL 13 (push) Waiting to run
SQL / PostgreSQL 9.6 (push) Waiting to run
SQL / PostgreSQL latest (push) Waiting to run
Sync For-Container.md to Docker Hub / sync (push) Waiting to run

Remove tools/dev_update_schema.sh
This commit is contained in:
Alvar 2026-01-13 16:12:04 +00:00 committed by GitHub
commit d0953e586a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,31 +0,0 @@
#!/bin/bash
set -e
set -o pipefail
cd "$(dirname "$0")"
BASEDIR=".."
test "$1" = '-f' || (
echo "Run '$0' -f to DROP ALL ICINGADB TABLES and re-create them using the current schema"
false
)
set -x
(
mysql -uroot -e 'SHOW TABLES\G' icingadb </dev/null |\
( grep -Ee '^Tables_in_icingadb: ' || true ) |\
cut -d ' ' -f 2 |\
perl -pe 's/^(.*?)$/DROP TABLE $1;/'
mysql -uroot -e 'SHOW PROCEDURE STATUS\G' icingadb </dev/null |\
( grep -Ee '^ *Name: ' || true ) |\
cut -d ':' -f 2 |\
perl -pe 's/^ *(.*?)$/DROP PROCEDURE IF EXISTS $1;/'
cat $BASEDIR/etc/schema/mysql/{,helper/}*.sql
echo "GRANT ALL ON icingadb.* TO 'icingadb'@'127.0.0.1' IDENTIFIED BY 'icingadb';"
) |mysql -uroot icingadb