op.create_schema('OurHouse')
op.create_table('Students',sa.Column('Id', sa.Integer(), server_default=sa.FetchedValue(), nullable=False),sa.Column('FirstName', sa.String(length=50), nullable=False),sa.Column('LastName', sa.String(length=50), nullable=False),sa.Column('Email', sa.String(length=62), nullable=False),sa.Column('Phone', sa.String(length=10), nullable=False),sa.Column('IsActive', sa.Boolean(), nullable=False),sa.Column('CreatedAt', sa.DateTime(timezone=True), nullable=False),sa.Column('UpdatedAt', sa.DateTime(timezone=True), nullable=False),sa.PrimaryKeyConstraint('Id'),schema='OurHouse')
You want to just create the schema, op.execute("CREATE SCHEMA OurHouse")
On 03/02/2017 10:26 AM, Josie Barth wrote:
> One clarifying edit:
>
> Regarding my example table,
>
> __table_args__ = {u'schema': 'OurHouse'}
>
> should not be commented out. I was playing around with the migration
> and I got it to work when I took out all references to the schema
> 'OurHouse' that I wanted to attach my tables to. The tables by default
> migrated to the "public" schema without issue. Further, if I manually
> added the schema 'OurHouse' to PostgreSQL before attempting to
> migrate, I was able to then migrate my tables to the schema without
> issue. My question still remains if it's possible to create a new
> schema name during migration so the tables can also be created without
> error. Thanks!
>
> --
> You received this message because you are subscribed to the Google
> Groups "sqlalchemy-alembic" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to sqlalchemy-alembic+unsub...@googlegroups.com
> <mailto:sqlalchemy-alembic+unsub...@googlegroups.com>.