When I migrate from sqlite to postgres, I cannot make any writes to the new database. The log shows the following error:
Unique key conflict id= 10, already exist in table ab_user
When I migrate from sqlite to postgres, I cannot make any writes to the new database. The log shows the following error:
Unique key conflict id= 10, already exist in table ab_user
Two potential scenarios:
Scenario A: You are starting from scratch and want to use Postgres instead of sqlite.
superset db upgrade this will create all the tables on Postgressuperset initScenario B: You have an already populated sqliteDB and want to migrate it to Postgres.
superset db upgrade and superset initinformation_schema.sequences otherwise you will hit unique key conflicts errors.In both scenarios you should see the message below after you have run superset db upgrade this means you have configured your superset_config.py properly.:
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
Make sure superset is looking at the config file by setting the environment variables:
export PYTHONPATH=/home/local_settings/:$PYTHONPATH
OR
export SUPERSET_CONFIG_PATH=/home/local_settings/