Server IP : 66.29.132.122 / Your IP : 18.216.111.153 Web Server : LiteSpeed System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : admazpex ( 531) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/proc/thread-self/root/proc/thread-self/root/proc/self/root/opt/imunify360/venv/lib64/python3.11/site-packages/defence360agent/migrations/ |
Upload File : |
import peewee as pw def migrate(migrator, database, fake=False, **kwargs): class RemoteProxyGroup(pw.Model): """Groups multiple remote proxies together with common data.""" MANUAL = "manual" IMUNIFY360 = "imunify360" name = pw.CharField(null=False) source = pw.CharField( null=False, constraints=[ pw.Check("source in ('{}', '{}')".format(MANUAL, IMUNIFY360)) ], ) enabled = pw.BooleanField(null=False, default=True) class Meta: db_table = "remote_proxy_group" indexes = ((("name", "source"), True),) class RemoteProxy(pw.Model): group = pw.ForeignKeyField(RemoteProxyGroup, null=False) network = pw.TextField(null=False) class Meta: db_table = "remote_proxy" migrator.create_model(RemoteProxyGroup) migrator.create_model(RemoteProxy) def rollback(migrator, database, fake=False, **kwargs): RemoteProxy = migrator.orm["remote_proxy"] RemoteProxyGroup = migrator.orm["remote_proxy_group"] migrator.remove_model(RemoteProxy) migrator.remove_model(RemoteProxyGroup)