Fix migration scripts (#18756)
* Fix migration scripts Set the DB schema version in DB prior to running migration https://community-daily.mattermost.com/boards/workspace/zyoahc9uapdn3xdptac6jb69ic/285b80a3-257d-41f6-8cf4-ed80ca9d92e5/495cdb4d-c13a-4992-8eb9-80cfee2819a4?c=c2525dbb-23eb-4fe7-8fb4-e9a5f503dc8c ```release-note NONE ``` * Revert schema to 6.0.0 and update CI scripts * Fix typo * Add missing default * Fix extra comma Co-authored-by: Claudio Costa <cstcld91@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
078fdd8422
Коммит
acd08f0a48
@@ -10,6 +10,8 @@ docker exec mattermost-postgres sh -c 'exec echo "CREATE DATABASE migrated; CREA
|
||||
echo "Importing postgres dump from version ${SCHEMA_VERSION}"
|
||||
docker exec -i mattermost-postgres psql -U mmuser -d migrated < $(pwd)/scripts/mattermost-postgresql-$SCHEMA_VERSION.sql
|
||||
|
||||
docker exec -i mattermost-postgres psql -U mmuser -d migrated -c "INSERT INTO Systems (Name, Value) VALUES ('Version', '$SCHEMA_VERSION')"
|
||||
|
||||
echo "Setting up config for db migration"
|
||||
cat config/config.json | \
|
||||
jq '.SqlSettings.DataSource = "postgres://mmuser:mostest@localhost:5432/migrated?sslmode=disable&connect_timeout=10"'| \
|
||||
@@ -26,7 +28,7 @@ cat config/config.json | \
|
||||
echo "Setting up fresh db"
|
||||
make ARGS="version --config $TMPDIR/config.json" run-cli
|
||||
|
||||
if [ "$SCHEMA_VERSION" == "5.0" ]; then
|
||||
if [ "$SCHEMA_VERSION" == "5.0.0" ]; then
|
||||
for i in "ChannelMembers MentionCountRoot" "ChannelMembers MsgCountRoot" "Channels TotalMsgCountRoot"; do
|
||||
a=( $i );
|
||||
echo "Ignoring known Postgres mismatch: ${a[0]}.${a[1]}"
|
||||
|
||||
Ссылка в новой задаче
Block a user