Skip to content

Commit

Permalink
Fix data handling (home-assistant#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
pvizeli authored Mar 10, 2019
1 parent 6148097 commit a532023
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions mariadb/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 1.2
- Change the way to migrate data

## 1.1
- Fix connection issue with 10.3.13

Expand Down
2 changes: 1 addition & 1 deletion mariadb/config.json
Original file line number Diff line number Diff line change
@@ -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/",
Expand Down
8 changes: 5 additions & 3 deletions mariadb/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a532023

Please sign in to comment.