mirror of https://github.com/jumpserver/jumpserver
				
				
				
			perf: add sftplog command models field index
							parent
							
								
									14a8d877e0
								
							
						
					
					
						commit
						f016ae6161
					
				|  | @ -0,0 +1,32 @@ | |||
| # Generated by Django 4.1.13 on 2025-04-21 06:15 | ||||
| 
 | ||||
| from django.db import migrations, models | ||||
| 
 | ||||
| 
 | ||||
| class Migration(migrations.Migration): | ||||
| 
 | ||||
|     dependencies = [ | ||||
|         ('audits', '0005_rename_serviceaccesslog'), | ||||
|     ] | ||||
| 
 | ||||
|     operations = [ | ||||
|         migrations.AlterField( | ||||
|             model_name='ftplog', | ||||
|             name='account', | ||||
|             field=models.CharField(db_index=True, max_length=128, verbose_name='Account'), | ||||
|         ), | ||||
|         migrations.AlterField( | ||||
|             model_name='ftplog', | ||||
|             name='asset', | ||||
|             field=models.CharField(db_index=True, max_length=1024, verbose_name='Asset'), | ||||
|         ), | ||||
|         migrations.AlterField( | ||||
|             model_name='ftplog', | ||||
|             name='date_start', | ||||
|             field=models.DateTimeField(auto_now_add=True, verbose_name='Date start'), | ||||
|         ), | ||||
|         migrations.AddIndex( | ||||
|             model_name='ftplog', | ||||
|             index=models.Index(fields=['date_start', 'org_id'], name='idx_date_start_org'), | ||||
|         ), | ||||
|     ] | ||||
|  | @ -56,19 +56,22 @@ class FTPLog(OrgModelMixin): | |||
|     remote_addr = models.CharField( | ||||
|         max_length=128, verbose_name=_("Remote addr"), blank=True, null=True | ||||
|     ) | ||||
|     asset = models.CharField(max_length=1024, verbose_name=_("Asset")) | ||||
|     account = models.CharField(max_length=128, verbose_name=_("Account")) | ||||
|     asset = models.CharField(max_length=1024, verbose_name=_("Asset"), db_index=True) | ||||
|     account = models.CharField(max_length=128, verbose_name=_("Account"), db_index=True) | ||||
|     operate = models.CharField( | ||||
|         max_length=16, verbose_name=_("Operate"), choices=OperateChoices.choices | ||||
|     ) | ||||
|     filename = models.CharField(max_length=1024, verbose_name=_("Filename")) | ||||
|     is_success = models.BooleanField(default=True, verbose_name=_("Success")) | ||||
|     date_start = models.DateTimeField(auto_now_add=True, verbose_name=_("Date start"), db_index=True) | ||||
|     date_start = models.DateTimeField(auto_now_add=True, verbose_name=_("Date start")) | ||||
|     has_file = models.BooleanField(default=False, verbose_name=_("Can Download")) | ||||
|     session = models.CharField(max_length=36, verbose_name=_("Session"), default=uuid.uuid4) | ||||
| 
 | ||||
|     class Meta: | ||||
|         verbose_name = _("File transfer log") | ||||
|         indexes = [ | ||||
|             models.Index(fields=['date_start', 'org_id'], name='idx_date_start_org'), | ||||
|         ] | ||||
| 
 | ||||
|     @property | ||||
|     def filepath(self): | ||||
|  |  | |||
|  | @ -0,0 +1,17 @@ | |||
| # Generated by Django 4.1.13 on 2025-04-21 06:15 | ||||
| 
 | ||||
| from django.db import migrations, models | ||||
| 
 | ||||
| 
 | ||||
| class Migration(migrations.Migration): | ||||
| 
 | ||||
|     dependencies = [ | ||||
|         ('terminal', '0006_endpoint_oracle_port'), | ||||
|     ] | ||||
| 
 | ||||
|     operations = [ | ||||
|         migrations.AddIndex( | ||||
|             model_name='command', | ||||
|             index=models.Index(fields=['timestamp', 'org_id'], name='idx_timestamp_org'), | ||||
|         ), | ||||
|     ] | ||||
|  | @ -74,3 +74,6 @@ class Command(AbstractSessionCommand): | |||
|         db_table = "terminal_command" | ||||
|         ordering = ('-timestamp',) | ||||
|         verbose_name = _('Command record') | ||||
|         indexes = [ | ||||
|             models.Index(fields=['timestamp', 'org_id'], name='idx_timestamp_org'), | ||||
|         ] | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 feng
						feng