mirror of
				https://github.com/StefBuwalda/dashboard_test.git
				synced 2025-10-31 03:39:58 +00:00 
			
		
		
		
	Migrate db to connect logs to service. Deleted any previous logs as they are useless
This commit is contained in:
		
							
								
								
									
										12
									
								
								models.py
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								models.py
									
									
									
									
									
								
							| @@ -1,12 +1,18 @@ | ||||
| from mem import db | ||||
| from datetime import datetime, timezone | ||||
| from validators import url as is_url | ||||
| from typing import Any | ||||
| from typing import Any, Optional | ||||
|  | ||||
|  | ||||
| class log(db.Model): | ||||
|     id: int = db.Column(db.Integer, primary_key=True) | ||||
|     dateCreated: datetime = db.Column(db.DateTime, nullable=False) | ||||
|     dateCreated: datetime = db.Column(db.DateTime, nullable=False, index=True) | ||||
|     service_id: int = db.Column( | ||||
|         db.Integer, | ||||
|         db.ForeignKey("service.id"), | ||||
|         nullable=False, | ||||
|     ) | ||||
|     ping: Optional[int] = db.Column(db.Integer, nullable=True) | ||||
|  | ||||
|     def __init__(self): | ||||
|         super().__init__() | ||||
| @@ -21,6 +27,8 @@ class service(db.Model): | ||||
|     public_access: bool = db.Column(db.Boolean, nullable=False) | ||||
|     ping_method: int = db.Column(db.Integer, nullable=False) | ||||
|  | ||||
|     logs = db.relationship("log") | ||||
|  | ||||
|     def __init__( | ||||
|         self, url: str, label: str, public_access: bool, ping_method: int | ||||
|     ): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user