feat: add governance bootstrap models
This commit is contained in:
53
backend/apps/accounts/migrations/0001_initial.py
Normal file
53
backend/apps/accounts/migrations/0001_initial.py
Normal file
@@ -0,0 +1,53 @@
|
||||
# Generated by Django 5.2.15 on 2026-07-01 06:04
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='MenuItem',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('code', models.CharField(max_length=120, unique=True)),
|
||||
('title', models.CharField(max_length=120)),
|
||||
('path', models.CharField(blank=True, max_length=200)),
|
||||
('icon', models.CharField(blank=True, max_length=80)),
|
||||
('sort_order', models.PositiveIntegerField(default=0)),
|
||||
('permission_code', models.CharField(blank=True, max_length=120)),
|
||||
('is_visible', models.BooleanField(default=True)),
|
||||
('is_enabled', models.BooleanField(default=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='accounts.menuitem')),
|
||||
],
|
||||
options={
|
||||
'ordering': ['sort_order', 'id'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='UserGroup',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=120, unique=True)),
|
||||
('code', models.CharField(max_length=80, unique=True)),
|
||||
('description', models.TextField(blank=True)),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('users', models.ManyToManyField(blank=True, related_name='business_groups', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['name'],
|
||||
},
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user