Merge pull request 'dev' (#27) from dev into master
All checks were successful
DEPLOY_MULTI_BRACH/pipeline/head This commit looks good
All checks were successful
DEPLOY_MULTI_BRACH/pipeline/head This commit looks good
Reviewed-on: #27
This commit was merged in pull request #27.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,7 +10,6 @@ deployments/docker-compose.yml
|
|||||||
postgres_data/
|
postgres_data/
|
||||||
local_postgres_data/
|
local_postgres_data/
|
||||||
*.pyc
|
*.pyc
|
||||||
apps/backend_admin/migrations/0001_initial.py
|
|
||||||
# Bloquear todos los .env en cualquier carpeta
|
# Bloquear todos los .env en cualquier carpeta
|
||||||
.env
|
.env
|
||||||
**/core/.env
|
**/core/.env
|
||||||
|
|||||||
35
apps/backend_admin/migrations/0001_initial.py
Normal file
35
apps/backend_admin/migrations/0001_initial.py
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# Generated by Django 5.0.3 on 2026-04-14 23:15
|
||||||
|
|
||||||
|
import django.utils.timezone
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
initial = True
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Log',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||||
|
('user_id', models.IntegerField(default=0)),
|
||||||
|
('user', models.CharField(default='anonimo', max_length=255)),
|
||||||
|
('app_id', models.IntegerField(default=0)),
|
||||||
|
('remote_address', models.GenericIPAddressField(blank=True, null=True)),
|
||||||
|
('request', models.JSONField(blank=True, null=True)),
|
||||||
|
('response', models.JSONField(blank=True, null=True)),
|
||||||
|
('status_code', models.CharField(default='0', max_length=10)),
|
||||||
|
('path', models.CharField(max_length=255)),
|
||||||
|
('method', models.CharField(max_length=10)),
|
||||||
|
('createdAt', models.DateTimeField(default=django.utils.timezone.now)),
|
||||||
|
('updatedAt', models.DateTimeField(auto_now=True)),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'db_table': 'audit_logs',
|
||||||
|
},
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -17,9 +17,10 @@ class Log(models.Model):
|
|||||||
createdAt = models.DateTimeField(default=timezone.now)
|
createdAt = models.DateTimeField(default=timezone.now)
|
||||||
updatedAt = models.DateTimeField(auto_now=True)
|
updatedAt = models.DateTimeField(auto_now=True)
|
||||||
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
db_table = 'audit_logs'
|
db_table = 'audit_logs'
|
||||||
managed = False # Al estar la tabla ya creada, Django no intentará modificarla
|
# managed = True <-- Asegúrate de que no esté en False
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{self.method} {self.path} ({self.status_code})"
|
return f"{self.method} {self.path} ({self.status_code})"
|
||||||
Reference in New Issue
Block a user