adds cleanup functionality for old devices
- device now last field 'last connection' which gets updated at every server connection from the respective device - manual cleanup script in database deletes all devices which have never been updated, or have a timestamp older than 30 days
This commit is contained in:
		
							
								
								
									
										28
									
								
								database/migrations/versions/121eab3835ee_.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								database/migrations/versions/121eab3835ee_.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
			
		||||
"""empty message
 | 
			
		||||
 | 
			
		||||
Revision ID: 121eab3835ee
 | 
			
		||||
Revises: e5ef5e4a807b
 | 
			
		||||
Create Date: 2020-07-17 08:03:36.947158
 | 
			
		||||
 | 
			
		||||
"""
 | 
			
		||||
from alembic import op
 | 
			
		||||
import sqlalchemy as sa
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# revision identifiers, used by Alembic.
 | 
			
		||||
revision = '121eab3835ee'
 | 
			
		||||
down_revision = 'e5ef5e4a807b'
 | 
			
		||||
branch_labels = None
 | 
			
		||||
depends_on = None
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def upgrade():
 | 
			
		||||
    # ### commands auto generated by Alembic - please adjust! ###
 | 
			
		||||
    op.add_column('device', sa.Column('lastConnection', sa.BigInteger(), nullable=True))
 | 
			
		||||
    # ### end Alembic commands ###
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def downgrade():
 | 
			
		||||
    # ### commands auto generated by Alembic - please adjust! ###
 | 
			
		||||
    op.drop_column('device', 'lastConnection')
 | 
			
		||||
    # ### end Alembic commands ###
 | 
			
		||||
		Reference in New Issue
	
	Block a user