I'm using postgres 10.5, python 3, flask and sqlalchemy. I'm trying to create a column in a users table with the following command
id = db.Column(db.Integer, db.Sequence('user_id_seq'), primary_key=True, autoincrement=True)

However, when I run this code and create a user, I get the error: 
error creating user (psycopg2.ProgrammingError) relation "user_id_seq" does not exist
How can I create the sequence 'user_id_seq' programmatically? Is there some way to check if it exists and create it if it does not using sqlalchemy
Interestingly, this just ended up being a problem with the way my database table was previously defined. I dropped the table, ran the code and the sequence existed correctly.
Creating a db.Sequence with sqalchemy