Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
Workaround for schema issue strapi/migration-scripts#19
Browse files Browse the repository at this point in the history
  • Loading branch information
grugnog committed Dec 15, 2022
1 parent 216905f commit 56bfad1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion v3-sql-v4-sql/config/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ additionalConfigV3 = {
port: 5432,
user: 'strapi',
password: process.env.DATABASE_PASSWORD,
database: 'strapi',
database: 'strapi3',
},
};

Expand Down
11 changes: 10 additions & 1 deletion v3-sql-v4-sql/reset-schema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,13 @@

export PGPASSWORD="${DATABASE_PASSWORD}"
psql -h "${DATABASE_HOST}" -U strapi -d strapi4 -c 'DROP SCHEMA public CASCADE;'
psql -h "${DATABASE_HOST}" -U strapi -d strapi4 -c 'CREATE SCHEMA public;'
psql -h "${DATABASE_HOST}" -U strapi -d strapi4 -c 'CREATE SCHEMA public;'

# Clone the v3 site to a new database, so we can wrangle some issues.
psql -h "${DATABASE_HOST}" -U strapi -d strapi -c 'DROP DATABASE IF EXISTS strapi3;'
psql -h "${DATABASE_HOST}" -U strapi -d strapi -c 'CREATE DATABASE strapi3 WITH TEMPLATE strapi OWNER strapi;'

# Wrangle schema issues

# https://github.com/strapi/migration-scripts/issues/19
psql -h "${DATABASE_HOST}" -U strapi -d strapi3 -c 'ALTER TABLE strapi_permission DROP COLUMN fields;'

0 comments on commit 56bfad1

Please sign in to comment.