flask / p.287 db 초기화 에러

안녕하세요. aws에서 며칠째 헤매고 있습니다..ㅠㅠ
flask db upgrade 명령으로 데이테베이스 초기화를 실행하려 했는데요.
다음과 같은 에러가 나옵니다..

Welcome to Ubuntu 20.04 LTS (GNU/Linux 5.4.0-1018-aws x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Thu Mar 11 10:45:03 KST 2021

  System load:           0.0
  Usage of /:            9.4% of 19.32GB
  Memory usage:          46%
  Swap usage:            0%
  Processes:             105
  Users logged in:       0
  IPv4 address for eth0: 172.26.7.101
  IPv6 address for eth0: 2406:da12:5f5:1c00:ad5b:ca56:bb7f:9865

 * Introducing self-healing high availability clusters in MicroK8s.
   Simple, hardened, Kubernetes for production, from RaspberryPi to DC.

     https://microk8s.io/high-availability

125 updates can be installed immediately.
11 of these updates are security updates.
To see these additional updates run: apt list --upgradable
  File "<string>", line 3, in drop_table
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/alembic/operations/ops.py", line 1166, in drop_t
able
    operations.invoke(op)
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/alembic/operations/base.py", line 354, in invoke
    return fn(self, operation)
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/alembic/operations/toimpl.py", line 72, in drop_
table
    operations.impl.drop_table(
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/alembic/ddl/impl.py", line 297, in drop_table
    self._exec(schema.DropTable(table))
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/alembic/ddl/impl.py", line 146, in _exec
    return conn.execute(construct, multiparams)
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execut
e
    return meth(self, multiparams, params)
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 72, in _execute_on_
connection
    return connection._execute_ddl(self, multiparams, params)
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1068, in _execu
te_ddl
    ret = self._execute_context(
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in _execu
te_context
    self._handle_dbapi_exception(
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in _handl
e_dbapi_exception
    util.raise_(
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execu
te_context
    self.dialect.do_execute(
  File "/home/ubuntu/venvs/myproject/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_e
xecute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: _alembic_tmp_question
[SQL: 
DROP TABLE _alembic_tmp_question]
(Background on this error at: http://sqlalche.me/e/13/e3q8)

_alembic_tmp_question 테이블이 없다는 걸까요? drop하라는 걸까요?
ㅠㅠ

likemika 565

M 2021년 3월 11일 7:38 오후

실행명령어랑 디렉터리 위치도 알려주세요. - 박응용님, 2021년 3월 11일 7:40 오후 추천 , 대댓글
해결하셨나요? - cjfgus983님, 2022년 5월 26일 11:27 오전 추천 , 대댓글
목록으로
1개의 답변이 있습니다. 1 / 1 Page

완전 초기화 하시려면 다음을 따라해 보세요.

myproject 디렉터리에서

$ rm pybo.db
$ rm -rf migrations
$ flask db init
$ flask db migrate
$ flask db upgrade

그러면 디비가 완전 초기화 됩니다.

박응용

2022년 11월 19일 10:35 오후