29 January 2016

Using SQLAlchemy to create table columns. To use numeric data types you have to use mysql dialects.

Source code viewer
  1. from alembic import op
  2. import sqlalchemy as sa
  3. from sqlalchemy.dialects.mysql import DECIMAL, TINYINT
  4.  
  5. op.create_table(
  6. 'accounting',
  7. sa.Column('id', sa.Integer(), primary_key=True),
  8. sa.Column('day', TINYINT()),
  9. sa.Column('price', DECIMAL(5, 2)),
  10. )
Programming Language: Python