diff options
| -rw-r--r-- | CHANGES.txt | 3 | ||||
| -rw-r--r-- | pyramid/scaffolds/alchemy/+package+/models.py | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 457bfc7b7..68799da4a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -162,6 +162,9 @@ Bug Fixes instance of DummyResource to be "falsy" instead of "truthy". See https://github.com/Pylons/pyramid/pull/1032 +- The ``alchemy`` scaffold would break when the database was MySQL during + tables creation. See https://github.com/Pylons/pyramid/pull/1049 + 1.4 (2012-12-18) ================ diff --git a/pyramid/scaffolds/alchemy/+package+/models.py b/pyramid/scaffolds/alchemy/+package+/models.py index aeeb9df64..db1fee832 100644 --- a/pyramid/scaffolds/alchemy/+package+/models.py +++ b/pyramid/scaffolds/alchemy/+package+/models.py @@ -1,5 +1,6 @@ from sqlalchemy import ( Column, + Index, Integer, Text, ) @@ -20,9 +21,11 @@ Base = declarative_base() class MyModel(Base): __tablename__ = 'models' id = Column(Integer, primary_key=True) - name = Column(Text, unique=True) + name = Column(Text) value = Column(Integer) def __init__(self, name, value): self.name = name self.value = value + +Index('my_index', MyModel.name, unique=True, mysql_length=255) |
