Skip to content

Commit

Permalink
Merge pull request #10 from serlo/8-update-db-dump-to-newest-version
Browse files Browse the repository at this point in the history
feat: Update SQL definition to current one
  • Loading branch information
kulla authored Aug 28, 2023
2 parents 4c6457c + d1df8e3 commit acaaeb3
Show file tree
Hide file tree
Showing 4 changed files with 232 additions and 421,473 deletions.
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,26 @@ help:
@echo "help – Show this help"
@echo "up – Start the mysql container locally"
@echo "down – Stop the mysql container"
@echo "dump – Dump to the local `.sql` file"
@echo "dump – Dump to the local '.sql' file"
@echo "mysql – Connect to local MySQL server with a shell"
@echo "rollback – Rollback to local '.sql' file"

up:
docker compose up --detach
docker compose up --build --detach

down:
docker compose down

dump:
docker compose exec -T mysql mysqldump --user=root --password=secret \
--lock-all-tables --complete-insert --skip-extended-insert \
--comments --skip-dump-date --default-character-set=utf8 \
--lock-all-tables --default-character-set=utf8mb4 \
--databases serlo > docker-entrypoint-initdb.d/001-init.sql

mysql:
docker compose exec -it mysql serlo-mysql

rollback:
docker compose cp docker-entrypoint-initdb.d/001-init.sql \
mysql:/docker-entrypoint-initdb.d/001-init.sql
docker compose exec mysql \
sh -c "pv /docker-entrypoint-initdb.d/001-init.sql | serlo-mysql"
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0
0.2.0
1 change: 1 addition & 0 deletions conf.d/serlo.cnf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[client]
default-character-set=utf8mb4
user=root
password=secret
database=serlo
Loading

0 comments on commit acaaeb3

Please sign in to comment.