K
K
kunjut192020-05-20 01:21:39
PostgreSQL
kunjut19, 2020-05-20 01:21:39

Why nothing happens when adding a table in Postgresql?

I'm trying to create and add a table in Postgresql, but something doesn't work.

create a table

class User(db.Model):
  id = db.Column(db.Integer, primary_key=True)
  usenmr = db.Column(db.String(10), unique=True)


specify the database
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://postgres:[email protected]/testtab'
db = SQLAlchemy(app)


but db.create_all() does nothing. The command is simply accepted, no logs or error messages, just a new line and waiting for a new command. In pgAdmin, the new table does not appear, of course. Tell me what am I doing wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question