179 lines
6.3 KiB
Python
179 lines
6.3 KiB
Python
# Generated by Django 5.2.12 on 2026-03-16 11:19
|
|
|
|
import core.models
|
|
import django.db.models.deletion
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = []
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="ClubEvent",
|
|
fields=[
|
|
("id", models.BigAutoField(primary_key=True, serialize=False)),
|
|
("date_ref", models.TextField(unique=True)),
|
|
("data", models.TextField(default="{}")),
|
|
],
|
|
options={
|
|
"db_table": "club_events",
|
|
"managed": True,
|
|
},
|
|
bases=(models.Model, core.models.JsonTextMixin),
|
|
),
|
|
migrations.CreateModel(
|
|
name="Config",
|
|
fields=[
|
|
("key", models.TextField(primary_key=True, serialize=False)),
|
|
("value", models.TextField(default="")),
|
|
],
|
|
options={
|
|
"db_table": "config",
|
|
"managed": True,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="Invitation",
|
|
fields=[
|
|
("id", models.BigAutoField(primary_key=True, serialize=False)),
|
|
("code", models.TextField(unique=True)),
|
|
("active", models.IntegerField(default=1)),
|
|
("single_use", models.IntegerField(default=1)),
|
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
],
|
|
options={
|
|
"db_table": "invitations",
|
|
"managed": True,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="Organization",
|
|
fields=[
|
|
("id", models.BigAutoField(primary_key=True, serialize=False)),
|
|
(
|
|
"org_id",
|
|
models.TextField(
|
|
blank=True, default=core.models.generate_short_uuid, unique=True
|
|
),
|
|
),
|
|
("org_name", models.TextField(default="")),
|
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
],
|
|
options={
|
|
"db_table": "organizaciones",
|
|
"managed": True,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="User",
|
|
fields=[
|
|
("id", models.BigAutoField(primary_key=True, serialize=False)),
|
|
("username", models.TextField(unique=True)),
|
|
("display_name", models.TextField(default="")),
|
|
("email", models.TextField(default="")),
|
|
("password_hash", models.TextField(default="")),
|
|
("permissions", models.TextField(default="[]")),
|
|
("google_auth", models.IntegerField(default=0)),
|
|
("meta", models.TextField(default="{}")),
|
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
("updated_at", models.DateTimeField(auto_now=True)),
|
|
],
|
|
options={
|
|
"db_table": "users",
|
|
"managed": True,
|
|
},
|
|
bases=(models.Model, core.models.JsonTextMixin),
|
|
),
|
|
migrations.CreateModel(
|
|
name="UserSession",
|
|
fields=[
|
|
("id", models.BigAutoField(primary_key=True, serialize=False)),
|
|
("session_token", models.TextField(unique=True)),
|
|
("username", models.TextField()),
|
|
("ip_address", models.TextField(default="")),
|
|
("user_agent", models.TextField(default="")),
|
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
("last_active", models.DateTimeField(auto_now=True)),
|
|
("remember_token_hash", models.TextField(blank=True, null=True)),
|
|
],
|
|
options={
|
|
"db_table": "user_sessions",
|
|
"managed": True,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="Aulario",
|
|
fields=[
|
|
("id", models.BigAutoField(primary_key=True, serialize=False)),
|
|
(
|
|
"aulario_id",
|
|
models.TextField(default=core.models.generate_short_uuid),
|
|
),
|
|
("name", models.TextField(default="")),
|
|
(
|
|
"icon_file",
|
|
models.FileField(
|
|
blank=True,
|
|
null=True,
|
|
upload_to=core.models.aulario_icon_upload_to,
|
|
),
|
|
),
|
|
("extra", models.TextField(default="{}")),
|
|
(
|
|
"org",
|
|
models.ForeignKey(
|
|
db_column="org_id",
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
to="core.organization",
|
|
to_field="org_id",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"db_table": "aularios",
|
|
"managed": True,
|
|
},
|
|
bases=(models.Model, core.models.JsonTextMixin),
|
|
),
|
|
migrations.CreateModel(
|
|
name="UserOrg",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
db_column="rowid", primary_key=True, serialize=False
|
|
),
|
|
),
|
|
("role", models.TextField(default="")),
|
|
("ea_aulas", models.TextField(default="[]")),
|
|
(
|
|
"org",
|
|
models.ForeignKey(
|
|
db_column="org_id",
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
to="core.organization",
|
|
to_field="org_id",
|
|
),
|
|
),
|
|
(
|
|
"user",
|
|
models.ForeignKey(
|
|
db_column="user_id",
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
to="core.user",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"db_table": "user_orgs",
|
|
"managed": True,
|
|
"unique_together": {("user", "org")},
|
|
},
|
|
bases=(models.Model, core.models.JsonTextMixin),
|
|
),
|
|
]
|