2020-02-06 20:49:18,809 INFO sqlalchemy.engine.base.Engine select version()
2020-02-06 20:49:18,809 INFO sqlalchemy.engine.base.Engine {}
2020-02-06 20:49:19,006 INFO sqlalchemy.engine.base.Engine select current_schema()
2020-02-06 20:49:19,007 INFO sqlalchemy.engine.base.Engine {}
2020-02-06 20:49:19,203 INFO sqlalchemy.engine.base.Engine SELECT CAST('test plain returns' AS VARCHAR(60)) AS anon_1
2020-02-06 20:49:19,203 INFO sqlalchemy.engine.base.Engine {}
2020-02-06 20:49:19,306 INFO sqlalchemy.engine.base.Engine SELECT CAST('test unicode returns' AS VARCHAR(60)) AS anon_1
2020-02-06 20:49:19,307 INFO sqlalchemy.engine.base.Engine {}
2020-02-06 20:49:19,407 INFO sqlalchemy.engine.base.Engine show standard_conforming_strings
2020-02-06 20:49:19,407 INFO sqlalchemy.engine.base.Engine {}
2020-02-06 20:49:19,621 INFO sqlalchemy.engine.base.Engine
CREATE TABLE users (
id SERIAL NOT NULL,
tg_id VARCHAR,
budget INTEGER,
PRIMARY KEY (id)
)
2020-02-06 20:49:19,621 INFO sqlalchemy.engine.base.Engine {}
2020-02-06 20:49:19,829 INFO sqlalchemy.engine.base.Engine COMMIT
2020-02-06 20:49:19,929 INFO sqlalchemy.engine.base.Engine
CREATE TABLE expenses (
id SERIAL NOT NULL,
name VARCHAR,
price INTEGER,
purchase_type VARCHAR,
date TIMESTAMP WITHOUT TIME ZONE,
customer_id VARCHAR,
PRIMARY KEY (id),
FOREIGN KEY(customer_id) REFERENCES users (tg_id)
)
2020-02-06 20:49:19,930 INFO sqlalchemy.engine.base.Engine {}
2020-02-06 20:49:20,163 INFO sqlalchemy.engine.base.Engine ROLLBACK
Traceback (most recent call last):
File "C:\Users\User\Desktop\Python\TBot_Socks\venv\lib\site-packages\sqlalchemy\engine\base.py", line 1246, in _execute_context
cursor, statement, parameters, context
File "C:\Users\User\Desktop\Python\TBot_Socks\venv\lib\site-packages\sqlalchemy\engine\default.py", line 581, in do_execute
cursor.execute(statement, parameters)
psycopg2.errors.InvalidForeignKey: there is no unique constraint matching given keys for referenced table "users"