This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Support timezone field | |
| Use func.now() to support timezone as utctime.now doesn't has this info | |
| Note: postgress always store in UTC time and send the converted timezone value according to client configurations `-c timezone=America/Sao_Paulo` | |
| `date_created = db.Column(db.DateTime(timezone=True), nullable=True, default=func.now())` | |
| # Column default value server_side | |
| Use `server_default`, useful when running migrations that creates non-nullable columns | |
| ``` | |
| op.add_column( | |
| 'execution_orders', sa.Column('total', sa.Integer(), nullable=False, server_default='0') |