I created a table with a primary key and a sequence but via the debug ad later looking at the table design, the sequence isn\'t applied, just created.
from s
You specified an explicit Sequence()
object with name. If you were to omit that, then SERIAL
would be added to the id
primary key specification:
CREATE TABLE tramos (
id INTEGER SERIAL NOT NULL,
nombre VARCHAR,
tramo_data VARCHAR,
estado BOOLEAN,
PRIMARY KEY (id)
)
A DEFAULT
is only generated if the column is not a primary key.
When inserting, SQLAlchemy will issue a select nextval(..)
as needed to create a next value. See the PostgreSQL documentation for details.