Fix data handling (#540)

This commit is contained in:
Pascal Vizeli
2019-03-10 21:10:02 +01:00
committed by GitHub
parent 61480978d2
commit a532023544
3 changed files with 9 additions and 4 deletions

View File

@@ -1,5 +1,8 @@
# Changelog
## 1.2
- Change the way to migrate data
## 1.1
- Fix connection issue with 10.3.13

View File

@@ -1,6 +1,6 @@
{
"name": "MariaDB",
"version": "1.1",
"version": "1.2",
"slug": "mariadb",
"description": "An SQL database server",
"url": "https://home-assistant.io/addons/mariadb/",

View File

@@ -14,9 +14,6 @@ if [ ! -d "$MARIADB_DATA" ]; then
mysql_install_db --user=root --datadir="$MARIADB_DATA" > /dev/null
else
echo "[INFO] Use exists mariadb initial system"
mysqlcheck --no-defaults --check-upgrade --auto-repair --databases mysql --skip-write-binlog > /dev/null || true
mysqlcheck --no-defaults --all-databases --fix-db-names --fix-table-names --skip-write-binlog > /dev/null || true
mysqlcheck --no-defaults --check-upgrade --all-databases --auto-repair --skip-write-binlog > /dev/null || true
fi
# Start mariadb
@@ -29,6 +26,11 @@ while ! mysql -e "" 2> /dev/null; do
sleep 1
done
echo "[INFO] Check data integrity and fix corruptions"
mysqlcheck --no-defaults --check-upgrade --auto-repair --databases mysql --skip-write-binlog > /dev/null || true
mysqlcheck --no-defaults --all-databases --fix-db-names --fix-table-names --skip-write-binlog > /dev/null || true
mysqlcheck --no-defaults --check-upgrade --all-databases --auto-repair --skip-write-binlog > /dev/null || true
# Init databases
echo "[INFO] Init custom database"
for line in $DATABASES; do