It worked perfectly! Thank you!
El lunes, 2 de julio de 2018, 17:00:45 (UTC+2), Mike Bayer escribió:
>
> tables can be altered additively, sure
>
> from sqlalchemy import *
> from sqlalchemy.schema import CreateTable
>
> m = MetaData()
>
> # table w/ no PK
> t = Table(
> "nopk", m,
>
tables can be altered additively, sure
from sqlalchemy import *
from sqlalchemy.schema import CreateTable
m = MetaData()
# table w/ no PK
t = Table(
"nopk", m,
Column('q', Integer),
Column('p', Integer)
)
# add a column w/ pk=True
t.append_column(Column('id', Integer,
Hello!
Is there a way to redefine a table in metadata?
I'm trying to define a table without pk to create this way in the database,
and then trying to add the pk to the definition to use it.
But I'm always getting this error
sqlalchemy.exc.ArgumentError: Column object 'column' already assigned to