Closed LunarTwilight closed 1 year ago
I cannot replicate.
test1
columnWeird, now I can't reproduce it either. I can get an "internal server error" page if I try to drop the only row in a table tho.
[2023-09-06 05:07:02,478] ERROR in app: Exception on /test/drop-column/ [POST]
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/peewee.py", line 3197, in execute_sql
cursor.execute(sql, params or ())
sqlite3.OperationalError: near ")": syntax error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 2525, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1822, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1820, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1796, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/usr/local/lib/python3.10/dist-packages/sqlite_web/sqlite_web.py", line 248, in inner
return fn(table, *args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/sqlite_web/sqlite_web.py", line 347, in drop_column
migrate(migrator.drop_column(table, name))
File "/usr/local/lib/python3.10/dist-packages/playhouse/migrate.py", line 886, in migrate
operation.run()
File "/usr/local/lib/python3.10/dist-packages/playhouse/migrate.py", line 164, in run
self._handle_result(method(*self.args, **kwargs))
File "/usr/local/lib/python3.10/dist-packages/playhouse/migrate.py", line 155, in _handle_result
result.run()
File "/usr/local/lib/python3.10/dist-packages/playhouse/migrate.py", line 164, in run
self._handle_result(method(*self.args, **kwargs))
File "/usr/local/lib/python3.10/dist-packages/playhouse/migrate.py", line 158, in _handle_result
self._handle_result(item)
File "/usr/local/lib/python3.10/dist-packages/playhouse/migrate.py", line 153, in _handle_result
self.execute(result)
File "/usr/local/lib/python3.10/dist-packages/playhouse/migrate.py", line 149, in execute
self.migrator.database.execute(node)
File "/usr/local/lib/python3.10/dist-packages/peewee.py", line 3210, in execute
return self.execute_sql(sql, params, commit=commit)
File "/usr/local/lib/python3.10/dist-packages/peewee.py", line 3194, in execute_sql
with __exception_wrapper__:
File "/usr/local/lib/python3.10/dist-packages/peewee.py", line 2970, in __exit__
reraise(new_type, new_type(exc_value, *exc_args), traceback)
File "/usr/local/lib/python3.10/dist-packages/peewee.py", line 191, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.10/dist-packages/peewee.py", line 3197, in execute_sql
cursor.execute(sql, params or ())
peewee.OperationalError: near ")": syntax error
DB schema: (also happens with no primary key too)
As for the contents of the table, I just put gibberish for each of the rows in the
test
column, for thetest1
column I set the first two rows to NULL and set the last row to gibberish.