mirror of
				https://github.com/StefBuwalda/cal_counter.git
				synced 2025-10-30 11:19:59 +00:00 
			
		
		
		
	This migration alters the 'energy_100' column in the 'food_item' table from INTEGER to Float to allow for decimal values. The downgrade reverses this change.
		
			
				
	
	
		
			39 lines
		
	
	
		
			995 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			995 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| """empty message
 | |
| 
 | |
| Revision ID: dea130d45cec
 | |
| Revises: f5fbbe915d51
 | |
| Create Date: 2025-08-11 16:51:55.485569
 | |
| 
 | |
| """
 | |
| from alembic import op
 | |
| import sqlalchemy as sa
 | |
| 
 | |
| 
 | |
| # revision identifiers, used by Alembic.
 | |
| revision = 'dea130d45cec'
 | |
| down_revision = 'f5fbbe915d51'
 | |
| branch_labels = None
 | |
| depends_on = None
 | |
| 
 | |
| 
 | |
| def upgrade():
 | |
|     # ### commands auto generated by Alembic - please adjust! ###
 | |
|     with op.batch_alter_table('food_item', schema=None) as batch_op:
 | |
|         batch_op.alter_column('energy_100',
 | |
|                existing_type=sa.INTEGER(),
 | |
|                type_=sa.Float(),
 | |
|                existing_nullable=False)
 | |
| 
 | |
|     # ### end Alembic commands ###
 | |
| 
 | |
| 
 | |
| def downgrade():
 | |
|     # ### commands auto generated by Alembic - please adjust! ###
 | |
|     with op.batch_alter_table('food_item', schema=None) as batch_op:
 | |
|         batch_op.alter_column('energy_100',
 | |
|                existing_type=sa.Float(),
 | |
|                type_=sa.INTEGER(),
 | |
|                existing_nullable=False)
 | |
| 
 | |
|     # ### end Alembic commands ###
 |