update
This commit is contained in:
31
db-anpassen
Executable file
31
db-anpassen
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
# Usage: db-anpassen <projekt-pfad>
|
||||
# Macht eine frisch importierte DB lokal nutzbar:
|
||||
# Kunden-Mails bereinigen, Admin team3 anlegen, Mailversand auf Mailpit.
|
||||
set -euo pipefail
|
||||
|
||||
cd "$1"
|
||||
|
||||
echo "Kunden-Mails bereinigen"
|
||||
ddev mysql -e "UPDATE customer SET email = CONCAT('test+customer-', customer_number, '@mitho-media.de');"
|
||||
|
||||
echo "Admin team3"
|
||||
if [ -n "$(ddev mysql -N -e "SELECT 1 FROM user WHERE username = 'team3';")" ]; then
|
||||
ddev exec bin/console user:change-password team3 --password='aisool8sahjaeThaiDie'
|
||||
else
|
||||
ddev exec bin/console user:create team3 --admin --password='aisool8sahjaeThaiDie' \
|
||||
--email='team3@mitho-media.de' --firstName='Team3' --lastName='Team3'
|
||||
fi
|
||||
|
||||
echo "Mailversand auf Mailpit"
|
||||
ddev exec bin/console system:config:set core.mailerSettings.emailAgent smtp
|
||||
ddev exec bin/console system:config:set core.mailerSettings.host 127.0.0.1
|
||||
ddev exec bin/console system:config:set core.mailerSettings.port 1025 --json
|
||||
ddev exec bin/console system:config:set core.mailerSettings.encryption null --json
|
||||
ddev exec bin/console system:config:set core.mailerSettings.username null --json
|
||||
ddev exec bin/console system:config:set core.mailerSettings.password null --json
|
||||
|
||||
ddev exec bin/console cache:clear
|
||||
|
||||
echo
|
||||
echo "Fertig."
|
||||
Reference in New Issue
Block a user