Migrate superset db from sqlite to postgres fails key constraints
Make sure these boxes are checked before submitting your issue - thank you!
- [x] I have checked the superset logs for python stacktraces and included it here as text if any
- [ ] I have reproduced the issue with at least the latest released version of superset
- [x] I have checked the issue tracker for the same issue and I haven't found one similar
Superset version
0.15.4
Expected results
I've previously migrated data from one sqlite to a fresh new sqlite database with no issues. Now when I've ported the raw table data from sqlite into postgres, I get primary key errors when trying to create new tables /slices/dashboards through superset directly post migration. I checked and the primary keys in postgres aren't sequences that need to be reset. So there must be some other indexing happening with superset directly.
Is there a way to reset the index/counters?
I've checked and each attempt to add a table will increment the ID even if it fails. Eventually it works, but fails due to column IDs not incrementing.
Actual results
Steps to reproduce
I am also getting an issue when I attempt to migrate my Postgres with the most recent update. I am getting the following errors when I run superset db migrate. The db is hosted on RDS and was working prior to the migration.
Traceback (most recent call last):
File "/home/ubuntu/venv/bin/superset", line 15, in <module>
manager.run()
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/flask_script/__init__.py", line 412, in run
result = self.handle(sys.argv[0], sys.argv[1:])
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/flask_script/__init__.py", line 383, in handle
res = handle(*args, **config)
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/flask_script/commands.py", line 216, in __call__
return self.run(*args, **kwargs)
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/flask_migrate/__init__.py", line 155, in migrate
version_path=version_path, rev_id=rev_id)
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/alembic/command.py", line 176, in revision
script_directory.run_env()
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/alembic/script/base.py", line 416, in run_env
util.load_python_file(self.dir, 'env.py')
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/alembic/util/pyfiles.py", line 93, in load_python_file
module = load_module_py(module_id, path)
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/alembic/util/compat.py", line 75, in load_module_py
mod = imp.load_source(module_id, path, fp)
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/superset/migrations/env.py", line 100, in <module>
run_migrations_online()
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/superset/migrations/env.py", line 93, in run_migrations_online
context.run_migrations()
File "<string>", line 8, in run_migrations
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/alembic/runtime/environment.py", line 817, in run_migrations
self.get_context().run_migrations(**kw)
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/alembic/runtime/migration.py", line 314, in run_migrations
for step in self._migrations_fn(heads, self):
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/alembic/command.py", line 156, in retrieve_migrations
revision_context.run_autogenerate(rev, context)
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/alembic/autogenerate/api.py", line 415, in run_autogenerate
self._run_environment(rev, migration_context, True)
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/alembic/autogenerate/api.py", line 427, in _run_environment
raise util.CommandError("Target database is not up to date.")
alembic.util.exc.CommandError: Target database is not up to date.
This looks like more of an alembic / flask-migrate issue rather than a superset one
Do you have any tips on how to address it?
Notice: this issue has been closed because it has been inactive for 383 days. Feel free to comment and request for this issue to be reopened.