Commit c3b97fdd239b516cbc0308762a130f103e7c2f1a
Fix db create error in MySQL
- MySQL needs fixed lengths in VARCHAR datatypes. Fixing code to have that
for MySQL.
| |   |
20 | 20 | |
21 | 21 | # Import all modules which represents a SQLAlchemy model; |
22 | 22 | # they have corresponding tables that are needed to be created |
from swtstore.classes.models import Sweet, Context, Client, AuthorizedClients |
from swtstore.classes.models import Sweet, Context, Client |
24 | 24 | from swtstore.classes.models.um import User, Group, Membership |
25 | 25 | |
# Create them! |
db.create_all() |
|
if __name__ == '__main__': |
# Create them! |
db.create_all() |
| |   |
25 | 25 | context_id = db.Column(db.Integer, db.ForeignKey('contexts.id')) |
26 | 26 | what = db.relationship('Context') |
27 | 27 | |
where = db.Column(db.String, nullable=False) |
where = db.Column(db.UnicodeText, nullable=False) |
29 | 29 | |
30 | 30 | how = db.Column(JSONType) |
31 | 31 | |
| |   |
15 | 15 | similarly, convert string to dict while loading from database |
16 | 16 | """ |
17 | 17 | |
impl = types.Unicode |
impl = types.UnicodeText |
19 | 19 | |
20 | 20 | def process_bind_param(self, value, dialect): |
21 | 21 | return json.dumps(value) |