C
C
CleanyBoom2022-01-21 12:39:42
Python
CleanyBoom, 2022-01-21 12:39:42

Weird peewee sqlite error?

Traceback (most recent call last): File "/home/niccord/site/sitevenv/lib/python3.8/site-packages/peewee.py", line 3160, in execute_sql cursor.execute(sql, params or ()) sqlite3.OperationalError: table webbills has no column named yoo_id During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/niccord/site/./ds.py", line 365, in buy Webbills.create(id=r, amount=price, File "/home/niccord/site/sitevenv/lib/python3.8/site-packages/peewee.py", line 6393, in create inst.save(force_insert= True) File "/home/niccord/site/sitevenv/lib/python3.8/site-packages/peewee.py", line 6603, in save pk = self.insert(**field_dict).execute() File "/ home/niccord/site/sitevenv/lib/python3.8/site-packages/peewee.py", line 1911, in inner return method(self, database,*args, **kwargs) File "/home/niccord/site/sitevenv/lib/python3.8/site-packages/peewee.py", line 1982, in execute return self._execute(database) File "/home/ niccord/site/sitevenv/lib/python3.8/site-packages/peewee.py", line 2761, in _execute return super(Insert, self)._execute(database) File "/home/niccord/site/sitevenv/lib /python3.8/site-packages/peewee.py", line 2479, in _execute cursor = database.execute(self) File "/home/niccord/site/sitevenv/lib/python3.8/site-packages/peewee. py", line 3173, in execute return self.execute_sql(sql, params, commit=commit) File "/home/niccord/site/sitevenv/lib/python3.8/site-packages/peewee.py", line 3167, in execute_sql self.commit() File "/home/niccord/site/sitevenv/lib/python3.8/site-packages/peewee.py", line 2933, in __exit__ reraise(new_type,new_type(exc_value, *exc_args), traceback) File "/home/niccord/site/sitevenv/lib/python3.8/site-packages/peewee.py", line 191, in reraise raise value.with_traceback(tb) File " /home/niccord/site/sitevenv/lib/python3.8/site-packages/peewee.py", line 3160, in execute_sql cursor.execute(sql, params or ()) peewee.OperationalError: table webbills has no column named yoo_id

I work with ready-made code using the peeweee library. The above error occurs. But there is a column in the table! I am attaching the screen.
PS When you run it on a local machine, there are no problems, as soon as you put it on the server, everything immediately dies at this moment
LVAx1Pn.png

upd. Model:
class Webbills(Model):
    id = BigAutoField(primary_key=True, unique=True)
    amount = IntegerField()
    status = IntegerField(default=0)
    time = IntegerField()
    type = TextField(default="")
    yoo_id = TextField(default="")

    class Meta:
        database = db

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AVKor, 2022-01-21
@AVKor

The error message says:

OperationalError: table webbills has no column named yoo_id During handling of the above exception, another exception occurred

...
PS When you run it on a local machine, there are no problems, as soon as you put it on the server, everything immediately dies at this moment

It means that something was done wrong on the server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question