
from meta import Base

from sqlalchemy import (
        Boolean,
        Column,
        ForeignKey,
        Table,
        Integer,
        Unicode,
        PrimaryKeyConstraint,
        UniqueConstraint,
        )

class Domain(Base):
    __table__ = Table('domains', Base.metadata,
            Column('id', Integer, primary_key=True, index=True),
            Column('domain', Unicode(256), index=True, unique=True),
            Column('owner', Integer, ForeignKey('users.id', onupdate="CASCADE", ondelete="RESTRICT"), nullable=False),
            )



from meta import Base

from sqlalchemy import (
        Boolean,
        Column,
        ForeignKey,
        Integer,
        PrimaryKeyConstraint,
        String,
        Table,
        Unicode,
        UniqueConstraint,
        )

class Domain(Base):
    __table__ = Table('domains', Base.metadata,
            Column('id', Integer, primary_key=True, index=True),
            Column('domain', String(256), index=True, unique=True),
            Column('owner', Integer, ForeignKey('users.id', onupdate="CASCADE", ondelete="RESTRICT"), nullable=False),
            )


Change from unicode to string for domain
Change from unicode to string for domain

DNS entries won't contain unicode characters, and by default are ASCII.

  
  from meta import Base
  
  from sqlalchemy import (
          Boolean,
          Column,
          ForeignKey,
+         Integer,
+         PrimaryKeyConstraint,
+         String,
          Table,
-         Integer,
          Unicode,
-         PrimaryKeyConstraint,
          UniqueConstraint,
          )
  
  class Domain(Base):
      __table__ = Table('domains', Base.metadata,
              Column('id', Integer, primary_key=True, index=True),
-             Column('domain', Unicode(256), index=True, unique=True),
+             Column('domain', String(256), index=True, unique=True),
              Column('owner', Integer, ForeignKey('users.id', onupdate="CASCADE", ondelete="RESTRICT"), nullable=False),
              )
  
  
Change from unicode to string for domain
## Code Before:

from meta import Base

from sqlalchemy import (
        Boolean,
        Column,
        ForeignKey,
        Table,
        Integer,
        Unicode,
        PrimaryKeyConstraint,
        UniqueConstraint,
        )

class Domain(Base):
    __table__ = Table('domains', Base.metadata,
            Column('id', Integer, primary_key=True, index=True),
            Column('domain', Unicode(256), index=True, unique=True),
            Column('owner', Integer, ForeignKey('users.id', onupdate="CASCADE", ondelete="RESTRICT"), nullable=False),
            )


## Instruction:
Change from unicode to string for domain
## Code After:

from meta import Base

from sqlalchemy import (
        Boolean,
        Column,
        ForeignKey,
        Integer,
        PrimaryKeyConstraint,
        String,
        Table,
        Unicode,
        UniqueConstraint,
        )

class Domain(Base):
    __table__ = Table('domains', Base.metadata,
            Column('id', Integer, primary_key=True, index=True),
            Column('domain', String(256), index=True, unique=True),
            Column('owner', Integer, ForeignKey('users.id', onupdate="CASCADE", ondelete="RESTRICT"), nullable=False),
            )

