Strapi Impossible to register the * model after clone the database

I basically clone the db through dump script then restore the db to the production version db.

Issue

1
2
3
4
5
6
7
8
9
10
11
12
[2020-02-21T10:25:10.090Z] error Impossible to register the 'types.article-type' model.
2020-02-21T10:25:54.291463332Z [2020-02-21T10:25:54.291Z] error error: relation "components_types_article_types" already exists
2020-02-21T10:25:54.291481081Z at Connection.parseE (/usr/src/strapi-20/node_modules/pg/lib/connection.js:614:13)
2020-02-21T10:25:54.291486902Z at Connection.parseMessage (/usr/src/strapi-20/node_modules/pg/lib/connection.js:413:19)
2020-02-21T10:25:54.291491872Z at Socket.<anonymous> (/usr/src/strapi-20/node_modules/pg/lib/connection.js:129:22)
2020-02-21T10:25:54.291497972Z at Socket.emit (events.js:321:20)
2020-02-21T10:25:54.291502522Z at addChunk (_stream_readable.js:297:12)
2020-02-21T10:25:54.291507102Z at readableAddChunk (_stream_readable.js:273:9)
2020-02-21T10:25:54.291511752Z at Socket.Readable.push (_stream_readable.js:214:10)
2020-02-21T10:25:54.291543832Z at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
2020-02-21T10:25:54.325005558Z error Command failed with exit code 1.
2020-02-21T10:25:54.325264823Z info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Steps to reproduce the behavior

  1. dump and restore db from local to remote
  2. change db creditials to production’s
  3. strapi start
  4. See error

Expected behavior
I assume it the whole db is the same, it should give a same strapi without any pain or differences.

Screenshots
If applicable, add screenshots to help explain your problem.

Code snippets
If applicable, add code samples to help explain your problem.

System

  • Node.js version: v10
  • NPM version: 6
  • Strapi version: v3 beta 18
  • Database: psql
  • Operating system: macos local, ubuntu 18 remote, both not work

Solution

  • The solution is to clone the user (who created the db locally) from local db to production db.