Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
3.5 kB
3
Indexable
Never
➜  reporting-app git:(migrations) ✗ sudo docker-compose run backend alembic revision --autogenerate -m 'delete user role'
Starting reporting-app_db_1 ... done
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
/usr/local/lib/python3.7/site-packages/alembic/script/revision.py:190: UserWarning: Revision 9e10992d6ebc referenced from 9e10992d6ebc -> 1a204abe1678, employee and project_office is not present
  % (downrev, rev)
Traceback (most recent call last):
  File "/usr/local/bin/alembic", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/alembic/config.py", line 559, in main
    CommandLine(prog=prog).main(argv=argv)
  File "/usr/local/lib/python3.7/site-packages/alembic/config.py", line 553, in main
    self.run_cmd(cfg, options)
  File "/usr/local/lib/python3.7/site-packages/alembic/config.py", line 533, in run_cmd
    **dict((k, getattr(options, k, None)) for k in kwarg)
  File "/usr/local/lib/python3.7/site-packages/alembic/command.py", line 212, in revision
    script_directory.run_env()
  File "/usr/local/lib/python3.7/site-packages/alembic/script/base.py", line 490, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/usr/local/lib/python3.7/site-packages/alembic/util/pyfiles.py", line 97, in load_python_file
    module = load_module_py(module_id, path)
  File "/usr/local/lib/python3.7/site-packages/alembic/util/compat.py", line 184, in load_module_py
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "alembic/env.py", line 91, in <module>
    run_migrations_online()
  File "alembic/env.py", line 85, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/usr/local/lib/python3.7/site-packages/alembic/runtime/environment.py", line 813, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/usr/local/lib/python3.7/site-packages/alembic/runtime/migration.py", line 549, in run_migrations
    for step in self._migrations_fn(heads, self):
  File "/usr/local/lib/python3.7/site-packages/alembic/command.py", line 188, in retrieve_migrations
    revision_context.run_autogenerate(rev, context)
  File "/usr/local/lib/python3.7/site-packages/alembic/autogenerate/api.py", line 462, in run_autogenerate
    self._run_environment(rev, migration_context, True)
  File "/usr/local/lib/python3.7/site-packages/alembic/autogenerate/api.py", line 474, in _run_environment
    self.script_directory.get_revisions("heads")
  File "/usr/local/lib/python3.7/site-packages/alembic/script/base.py", line 230, in get_revisions
    return self.revision_map.get_revisions(id_)
  File "/usr/local/lib/python3.7/site-packages/alembic/script/revision.py", line 459, in get_revisions
    resolved_id, branch_label = self._resolve_revision_number(id_)
  File "/usr/local/lib/python3.7/site-packages/alembic/script/revision.py", line 661, in _resolve_revision_number
    self._revision_map
  File "/usr/local/lib/python3.7/site-packages/alembic/util/langhelpers.py", line 234, in __get__
    obj.__dict__[self.__name__] = result = self.fget(obj)
  File "/usr/local/lib/python3.7/site-packages/alembic/script/revision.py", line 192, in _revision_map
    down_revision = map_[downrev]
KeyError: '9e10992d6ebc'