From 768e5e0c1bd64720694092806e8bd0aef342546f Mon Sep 17 00:00:00 2001
From: vincbeck <vincbeck@amazon.com>
Date: Fri, 5 Dec 2025 14:04:42 -0500
Subject: [PATCH] Remove team ID and use team name as PK

---
 airflow-core/docs/img/airflow_erd.sha256      |   2 +-
 airflow-core/docs/img/airflow_erd.svg         | 573 +++++++++---------
 airflow-core/docs/migrations-ref.rst          |   5 +-
 .../auth/managers/base_auth_manager.py        |  13 +-
 .../core_api/datamodels/ui/teams.py           |   3 -
 .../core_api/datamodels/variables.py          |   5 +-
 .../core_api/openapi/_private_ui.yaml         |  11 +-
 .../openapi/v2-rest-api-generated.yaml        |  13 +-
 .../api_fastapi/core_api/routes/ui/teams.py   |   2 +-
 .../src/airflow/cli/commands/team_command.py  |  13 +-
 .../versions/0094_3_1_0_remove_team_id.py     | 148 +++++
 airflow-core/src/airflow/models/connection.py |  24 +-
 airflow-core/src/airflow/models/pool.py       |  12 +-
 airflow-core/src/airflow/models/team.py       |  31 +-
 airflow-core/src/airflow/models/variable.py   |  42 +-
 .../ui/openapi-gen/queries/ensureQueryData.ts |   2 +-
 .../ui/openapi-gen/queries/prefetch.ts        |   2 +-
 .../airflow/ui/openapi-gen/queries/queries.ts |   2 +-
 .../ui/openapi-gen/queries/suspense.ts        |   2 +-
 .../ui/openapi-gen/requests/schemas.gen.ts    |  22 +-
 .../ui/openapi-gen/requests/services.gen.ts   |   2 +-
 .../ui/openapi-gen/requests/types.gen.ts      |   7 +-
 airflow-core/src/airflow/utils/db.py          |   2 +-
 .../auth/managers/test_base_auth_manager.py   |   6 +-
 .../api_fastapi/common/test_exceptions.py     |  12 +-
 .../core_api/routes/public/test_variables.py  |  45 +-
 .../core_api/routes/ui/test_teams.py          |   5 -
 .../unit/cli/commands/test_team_command.py    |  24 +-
 .../tests/unit/models/test_connection.py      |   7 +-
 airflow-core/tests/unit/models/test_pool.py   |   9 +-
 airflow-core/tests/unit/models/test_team.py   |  50 +-
 .../tests/unit/models/test_variable.py        |  15 +-
 .../airflowctl/api/datamodels/generated.py    |   8 +-
 .../src/tests_common/pytest_plugin.py         |   3 +-
 34 files changed, 592 insertions(+), 530 deletions(-)
 create mode 100644 airflow-core/src/airflow/migrations/versions/0094_3_1_0_remove_team_id.py

diff --git a/airflow-core/docs/img/airflow_erd.sha256 b/airflow-core/docs/img/airflow_erd.sha256
index 606ad8874e93a..aa301e6d30700 100644
--- a/airflow-core/docs/img/airflow_erd.sha256
+++ b/airflow-core/docs/img/airflow_erd.sha256
@@ -1 +1 @@
-5695a7ac6b40a0756c266fd4908e85d1857d18946e5be9735bf329fffc4beeff
\ No newline at end of file
+99114dbbb7c6e7ae792b0dd380c55901aea3185c7e8f969c2e44b8fa69e2a467
\ No newline at end of file
diff --git a/airflow-core/docs/img/airflow_erd.svg b/airflow-core/docs/img/airflow_erd.svg
index 8dc05c13a8f21..1ac7bcda5d68a 100644
--- a/airflow-core/docs/img/airflow_erd.svg
+++ b/airflow-core/docs/img/airflow_erd.svg
@@ -12,198 +12,198 @@
 <!-- dag_priority_parsing_request -->
 <g id="node1" class="node">
 <title>dag_priority_parsing_request</title>
-<polygon fill="none" stroke="black" points="25,-152.42 25,-180.42 345,-180.42 345,-152.42 25,-152.42"/>
-<text text-anchor="start" x="54" y="-163.62" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">dag_priority_parsing_request</text>
-<polygon fill="none" stroke="black" points="25,-127.42 25,-152.42 345,-152.42 345,-127.42 25,-127.42"/>
-<text text-anchor="start" x="30" y="-137.22" font-family="Helvetica,sans-Serif" text-decoration="underline" font-size="14.00">id</text>
-<text text-anchor="start" x="43" y="-137.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="48" y="-137.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(32)]</text>
-<text text-anchor="start" x="160" y="-137.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
-<polygon fill="none" stroke="black" points="25,-102.42 25,-127.42 345,-127.42 345,-102.42 25,-102.42"/>
-<text text-anchor="start" x="30" y="-112.22" font-family="Helvetica,sans-Serif" font-size="14.00">bundle_name</text>
-<text text-anchor="start" x="124" y="-112.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="129" y="-112.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
-<text text-anchor="start" x="250" y="-112.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
-<polygon fill="none" stroke="black" points="25,-77.42 25,-102.42 345,-102.42 345,-77.42 25,-77.42"/>
-<text text-anchor="start" x="30" y="-87.22" font-family="Helvetica,sans-Serif" font-size="14.00">relative_fileloc</text>
-<text text-anchor="start" x="129" y="-87.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="134" y="-87.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(2000)]</text>
-<text text-anchor="start" x="264" y="-87.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="25,-178.42 25,-206.42 345,-206.42 345,-178.42 25,-178.42"/>
+<text text-anchor="start" x="54" y="-189.62" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">dag_priority_parsing_request</text>
+<polygon fill="none" stroke="black" points="25,-153.42 25,-178.42 345,-178.42 345,-153.42 25,-153.42"/>
+<text text-anchor="start" x="30" y="-163.22" font-family="Helvetica,sans-Serif" text-decoration="underline" font-size="14.00">id</text>
+<text text-anchor="start" x="43" y="-163.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="48" y="-163.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(32)]</text>
+<text text-anchor="start" x="160" y="-163.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="25,-128.42 25,-153.42 345,-153.42 345,-128.42 25,-128.42"/>
+<text text-anchor="start" x="30" y="-138.22" font-family="Helvetica,sans-Serif" font-size="14.00">bundle_name</text>
+<text text-anchor="start" x="124" y="-138.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="129" y="-138.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
+<text text-anchor="start" x="250" y="-138.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="25,-103.42 25,-128.42 345,-128.42 345,-103.42 25,-103.42"/>
+<text text-anchor="start" x="30" y="-113.22" font-family="Helvetica,sans-Serif" font-size="14.00">relative_fileloc</text>
+<text text-anchor="start" x="129" y="-113.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="134" y="-113.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(2000)]</text>
+<text text-anchor="start" x="264" y="-113.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
 </g>
 <!-- job -->
 <g id="node2" class="node">
 <title>job</title>
-<polygon fill="none" stroke="black" points="66,-457.42 66,-485.42 304,-485.42 304,-457.42 66,-457.42"/>
-<text text-anchor="start" x="171" y="-468.62" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">job</text>
-<polygon fill="none" stroke="black" points="66,-432.42 66,-457.42 304,-457.42 304,-432.42 66,-432.42"/>
-<text text-anchor="start" x="71" y="-442.22" font-family="Helvetica,sans-Serif" text-decoration="underline" font-size="14.00">id</text>
-<text text-anchor="start" x="84" y="-442.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="89" y="-442.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
-<text text-anchor="start" x="166" y="-442.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
-<polygon fill="none" stroke="black" points="66,-407.42 66,-432.42 304,-432.42 304,-407.42 66,-407.42"/>
-<text text-anchor="start" x="71" y="-417.22" font-family="Helvetica,sans-Serif" font-size="14.00">dag_id</text>
-<text text-anchor="start" x="117" y="-417.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="122" y="-417.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
-<polygon fill="none" stroke="black" points="66,-382.42 66,-407.42 304,-407.42 304,-382.42 66,-382.42"/>
-<text text-anchor="start" x="71" y="-392.22" font-family="Helvetica,sans-Serif" font-size="14.00">end_date</text>
-<text text-anchor="start" x="135" y="-392.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="140" y="-392.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TIMESTAMP]</text>
-<polygon fill="none" stroke="black" points="66,-357.42 66,-382.42 304,-382.42 304,-357.42 66,-357.42"/>
-<text text-anchor="start" x="71" y="-367.22" font-family="Helvetica,sans-Serif" font-size="14.00">executor_class</text>
-<text text-anchor="start" x="173" y="-367.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="178" y="-367.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(500)]</text>
-<polygon fill="none" stroke="black" points="66,-332.42 66,-357.42 304,-357.42 304,-332.42 66,-332.42"/>
-<text text-anchor="start" x="71" y="-342.22" font-family="Helvetica,sans-Serif" font-size="14.00">hostname</text>
-<text text-anchor="start" x="141" y="-342.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="146" y="-342.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(500)]</text>
-<polygon fill="none" stroke="black" points="66,-307.42 66,-332.42 304,-332.42 304,-307.42 66,-307.42"/>
-<text text-anchor="start" x="71" y="-317.22" font-family="Helvetica,sans-Serif" font-size="14.00">job_type</text>
-<text text-anchor="start" x="130" y="-317.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="135" y="-317.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(30)]</text>
-<polygon fill="none" stroke="black" points="66,-282.42 66,-307.42 304,-307.42 304,-282.42 66,-282.42"/>
-<text text-anchor="start" x="71" y="-292.22" font-family="Helvetica,sans-Serif" font-size="14.00">latest_heartbeat</text>
-<text text-anchor="start" x="184" y="-292.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="189" y="-292.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TIMESTAMP]</text>
-<polygon fill="none" stroke="black" points="66,-257.42 66,-282.42 304,-282.42 304,-257.42 66,-257.42"/>
-<text text-anchor="start" x="71" y="-267.22" font-family="Helvetica,sans-Serif" font-size="14.00">start_date</text>
-<text text-anchor="start" x="141" y="-267.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="146" y="-267.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TIMESTAMP]</text>
-<polygon fill="none" stroke="black" points="66,-232.42 66,-257.42 304,-257.42 304,-232.42 66,-232.42"/>
-<text text-anchor="start" x="71" y="-242.22" font-family="Helvetica,sans-Serif" font-size="14.00">state</text>
-<text text-anchor="start" x="106" y="-242.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="111" y="-242.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(20)]</text>
-<polygon fill="none" stroke="black" points="66,-207.42 66,-232.42 304,-232.42 304,-207.42 66,-207.42"/>
-<text text-anchor="start" x="71" y="-217.22" font-family="Helvetica,sans-Serif" font-size="14.00">unixname</text>
-<text text-anchor="start" x="141" y="-217.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="146" y="-217.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(1000)]</text>
+<polygon fill="none" stroke="black" points="66,-483.42 66,-511.42 304,-511.42 304,-483.42 66,-483.42"/>
+<text text-anchor="start" x="171" y="-494.62" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">job</text>
+<polygon fill="none" stroke="black" points="66,-458.42 66,-483.42 304,-483.42 304,-458.42 66,-458.42"/>
+<text text-anchor="start" x="71" y="-468.22" font-family="Helvetica,sans-Serif" text-decoration="underline" font-size="14.00">id</text>
+<text text-anchor="start" x="84" y="-468.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="89" y="-468.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
+<text text-anchor="start" x="166" y="-468.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="66,-433.42 66,-458.42 304,-458.42 304,-433.42 66,-433.42"/>
+<text text-anchor="start" x="71" y="-443.22" font-family="Helvetica,sans-Serif" font-size="14.00">dag_id</text>
+<text text-anchor="start" x="117" y="-443.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="122" y="-443.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
+<polygon fill="none" stroke="black" points="66,-408.42 66,-433.42 304,-433.42 304,-408.42 66,-408.42"/>
+<text text-anchor="start" x="71" y="-418.22" font-family="Helvetica,sans-Serif" font-size="14.00">end_date</text>
+<text text-anchor="start" x="135" y="-418.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="140" y="-418.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TIMESTAMP]</text>
+<polygon fill="none" stroke="black" points="66,-383.42 66,-408.42 304,-408.42 304,-383.42 66,-383.42"/>
+<text text-anchor="start" x="71" y="-393.22" font-family="Helvetica,sans-Serif" font-size="14.00">executor_class</text>
+<text text-anchor="start" x="173" y="-393.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="178" y="-393.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(500)]</text>
+<polygon fill="none" stroke="black" points="66,-358.42 66,-383.42 304,-383.42 304,-358.42 66,-358.42"/>
+<text text-anchor="start" x="71" y="-368.22" font-family="Helvetica,sans-Serif" font-size="14.00">hostname</text>
+<text text-anchor="start" x="141" y="-368.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="146" y="-368.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(500)]</text>
+<polygon fill="none" stroke="black" points="66,-333.42 66,-358.42 304,-358.42 304,-333.42 66,-333.42"/>
+<text text-anchor="start" x="71" y="-343.22" font-family="Helvetica,sans-Serif" font-size="14.00">job_type</text>
+<text text-anchor="start" x="130" y="-343.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="135" y="-343.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(30)]</text>
+<polygon fill="none" stroke="black" points="66,-308.42 66,-333.42 304,-333.42 304,-308.42 66,-308.42"/>
+<text text-anchor="start" x="71" y="-318.22" font-family="Helvetica,sans-Serif" font-size="14.00">latest_heartbeat</text>
+<text text-anchor="start" x="184" y="-318.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="189" y="-318.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TIMESTAMP]</text>
+<polygon fill="none" stroke="black" points="66,-283.42 66,-308.42 304,-308.42 304,-283.42 66,-283.42"/>
+<text text-anchor="start" x="71" y="-293.22" font-family="Helvetica,sans-Serif" font-size="14.00">start_date</text>
+<text text-anchor="start" x="141" y="-293.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="146" y="-293.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TIMESTAMP]</text>
+<polygon fill="none" stroke="black" points="66,-258.42 66,-283.42 304,-283.42 304,-258.42 66,-258.42"/>
+<text text-anchor="start" x="71" y="-268.22" font-family="Helvetica,sans-Serif" font-size="14.00">state</text>
+<text text-anchor="start" x="106" y="-268.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="111" y="-268.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(20)]</text>
+<polygon fill="none" stroke="black" points="66,-233.42 66,-258.42 304,-258.42 304,-233.42 66,-233.42"/>
+<text text-anchor="start" x="71" y="-243.22" font-family="Helvetica,sans-Serif" font-size="14.00">unixname</text>
+<text text-anchor="start" x="141" y="-243.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="146" y="-243.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(1000)]</text>
 </g>
 <!-- log -->
 <g id="node3" class="node">
 <title>log</title>
-<polygon fill="none" stroke="black" points="45,-811.42 45,-839.42 326,-839.42 326,-811.42 45,-811.42"/>
-<text text-anchor="start" x="171.5" y="-822.62" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">log</text>
-<polygon fill="none" stroke="black" points="45,-786.42 45,-811.42 326,-811.42 326,-786.42 45,-786.42"/>
-<text text-anchor="start" x="50" y="-796.22" font-family="Helvetica,sans-Serif" text-decoration="underline" font-size="14.00">id</text>
-<text text-anchor="start" x="63" y="-796.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="68" y="-796.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
-<text text-anchor="start" x="145" y="-796.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
-<polygon fill="none" stroke="black" points="45,-761.42 45,-786.42 326,-786.42 326,-761.42 45,-761.42"/>
-<text text-anchor="start" x="50" y="-771.22" font-family="Helvetica,sans-Serif" font-size="14.00">dag_id</text>
-<text text-anchor="start" x="96" y="-771.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="101" y="-771.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
-<polygon fill="none" stroke="black" points="45,-736.42 45,-761.42 326,-761.42 326,-736.42 45,-736.42"/>
-<text text-anchor="start" x="50" y="-746.22" font-family="Helvetica,sans-Serif" font-size="14.00">dttm</text>
-<text text-anchor="start" x="84" y="-746.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="89" y="-746.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TIMESTAMP]</text>
-<polygon fill="none" stroke="black" points="45,-711.42 45,-736.42 326,-736.42 326,-711.42 45,-711.42"/>
-<text text-anchor="start" x="50" y="-721.22" font-family="Helvetica,sans-Serif" font-size="14.00">event</text>
-<text text-anchor="start" x="90" y="-721.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="95" y="-721.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(60)]</text>
-<polygon fill="none" stroke="black" points="45,-686.42 45,-711.42 326,-711.42 326,-686.42 45,-686.42"/>
-<text text-anchor="start" x="50" y="-696.22" font-family="Helvetica,sans-Serif" font-size="14.00">extra</text>
-<text text-anchor="start" x="87" y="-696.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="92" y="-696.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TEXT]</text>
-<polygon fill="none" stroke="black" points="45,-661.42 45,-686.42 326,-686.42 326,-661.42 45,-661.42"/>
-<text text-anchor="start" x="50" y="-671.22" font-family="Helvetica,sans-Serif" font-size="14.00">logical_date</text>
-<text text-anchor="start" x="132" y="-671.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="137" y="-671.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TIMESTAMP]</text>
-<polygon fill="none" stroke="black" points="45,-636.42 45,-661.42 326,-661.42 326,-636.42 45,-636.42"/>
-<text text-anchor="start" x="50" y="-646.22" font-family="Helvetica,sans-Serif" font-size="14.00">map_index</text>
-<text text-anchor="start" x="126" y="-646.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="131" y="-646.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
-<polygon fill="none" stroke="black" points="45,-611.42 45,-636.42 326,-636.42 326,-611.42 45,-611.42"/>
-<text text-anchor="start" x="50" y="-621.22" font-family="Helvetica,sans-Serif" font-size="14.00">owner</text>
-<text text-anchor="start" x="93" y="-621.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="98" y="-621.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(500)]</text>
-<polygon fill="none" stroke="black" points="45,-586.42 45,-611.42 326,-611.42 326,-586.42 45,-586.42"/>
-<text text-anchor="start" x="50" y="-596.22" font-family="Helvetica,sans-Serif" font-size="14.00">owner_display_name</text>
-<text text-anchor="start" x="195" y="-596.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="200" y="-596.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(500)]</text>
-<polygon fill="none" stroke="black" points="45,-561.42 45,-586.42 326,-586.42 326,-561.42 45,-561.42"/>
-<text text-anchor="start" x="50" y="-571.22" font-family="Helvetica,sans-Serif" font-size="14.00">run_id</text>
-<text text-anchor="start" x="94" y="-571.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="99" y="-571.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
-<polygon fill="none" stroke="black" points="45,-536.42 45,-561.42 326,-561.42 326,-536.42 45,-536.42"/>
-<text text-anchor="start" x="50" y="-546.22" font-family="Helvetica,sans-Serif" font-size="14.00">task_id</text>
-<text text-anchor="start" x="99" y="-546.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="104" y="-546.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
-<polygon fill="none" stroke="black" points="45,-511.42 45,-536.42 326,-536.42 326,-511.42 45,-511.42"/>
-<text text-anchor="start" x="50" y="-521.22" font-family="Helvetica,sans-Serif" font-size="14.00">try_number</text>
-<text text-anchor="start" x="132" y="-521.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="137" y="-521.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
+<polygon fill="none" stroke="black" points="45,-837.42 45,-865.42 326,-865.42 326,-837.42 45,-837.42"/>
+<text text-anchor="start" x="171.5" y="-848.62" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">log</text>
+<polygon fill="none" stroke="black" points="45,-812.42 45,-837.42 326,-837.42 326,-812.42 45,-812.42"/>
+<text text-anchor="start" x="50" y="-822.22" font-family="Helvetica,sans-Serif" text-decoration="underline" font-size="14.00">id</text>
+<text text-anchor="start" x="63" y="-822.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="68" y="-822.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
+<text text-anchor="start" x="145" y="-822.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="45,-787.42 45,-812.42 326,-812.42 326,-787.42 45,-787.42"/>
+<text text-anchor="start" x="50" y="-797.22" font-family="Helvetica,sans-Serif" font-size="14.00">dag_id</text>
+<text text-anchor="start" x="96" y="-797.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="101" y="-797.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
+<polygon fill="none" stroke="black" points="45,-762.42 45,-787.42 326,-787.42 326,-762.42 45,-762.42"/>
+<text text-anchor="start" x="50" y="-772.22" font-family="Helvetica,sans-Serif" font-size="14.00">dttm</text>
+<text text-anchor="start" x="84" y="-772.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="89" y="-772.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TIMESTAMP]</text>
+<polygon fill="none" stroke="black" points="45,-737.42 45,-762.42 326,-762.42 326,-737.42 45,-737.42"/>
+<text text-anchor="start" x="50" y="-747.22" font-family="Helvetica,sans-Serif" font-size="14.00">event</text>
+<text text-anchor="start" x="90" y="-747.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="95" y="-747.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(60)]</text>
+<polygon fill="none" stroke="black" points="45,-712.42 45,-737.42 326,-737.42 326,-712.42 45,-712.42"/>
+<text text-anchor="start" x="50" y="-722.22" font-family="Helvetica,sans-Serif" font-size="14.00">extra</text>
+<text text-anchor="start" x="87" y="-722.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="92" y="-722.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TEXT]</text>
+<polygon fill="none" stroke="black" points="45,-687.42 45,-712.42 326,-712.42 326,-687.42 45,-687.42"/>
+<text text-anchor="start" x="50" y="-697.22" font-family="Helvetica,sans-Serif" font-size="14.00">logical_date</text>
+<text text-anchor="start" x="132" y="-697.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="137" y="-697.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TIMESTAMP]</text>
+<polygon fill="none" stroke="black" points="45,-662.42 45,-687.42 326,-687.42 326,-662.42 45,-662.42"/>
+<text text-anchor="start" x="50" y="-672.22" font-family="Helvetica,sans-Serif" font-size="14.00">map_index</text>
+<text text-anchor="start" x="126" y="-672.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="131" y="-672.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
+<polygon fill="none" stroke="black" points="45,-637.42 45,-662.42 326,-662.42 326,-637.42 45,-637.42"/>
+<text text-anchor="start" x="50" y="-647.22" font-family="Helvetica,sans-Serif" font-size="14.00">owner</text>
+<text text-anchor="start" x="93" y="-647.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="98" y="-647.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(500)]</text>
+<polygon fill="none" stroke="black" points="45,-612.42 45,-637.42 326,-637.42 326,-612.42 45,-612.42"/>
+<text text-anchor="start" x="50" y="-622.22" font-family="Helvetica,sans-Serif" font-size="14.00">owner_display_name</text>
+<text text-anchor="start" x="195" y="-622.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="200" y="-622.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(500)]</text>
+<polygon fill="none" stroke="black" points="45,-587.42 45,-612.42 326,-612.42 326,-587.42 45,-587.42"/>
+<text text-anchor="start" x="50" y="-597.22" font-family="Helvetica,sans-Serif" font-size="14.00">run_id</text>
+<text text-anchor="start" x="94" y="-597.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="99" y="-597.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
+<polygon fill="none" stroke="black" points="45,-562.42 45,-587.42 326,-587.42 326,-562.42 45,-562.42"/>
+<text text-anchor="start" x="50" y="-572.22" font-family="Helvetica,sans-Serif" font-size="14.00">task_id</text>
+<text text-anchor="start" x="99" y="-572.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="104" y="-572.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
+<polygon fill="none" stroke="black" points="45,-537.42 45,-562.42 326,-562.42 326,-537.42 45,-537.42"/>
+<text text-anchor="start" x="50" y="-547.22" font-family="Helvetica,sans-Serif" font-size="14.00">try_number</text>
+<text text-anchor="start" x="132" y="-547.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="137" y="-547.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
 </g>
 <!-- partitioned_asset_key_log -->
 <g id="node4" class="node">
 <title>partitioned_asset_key_log</title>
-<polygon fill="none" stroke="black" points="8,-1065.42 8,-1093.42 362,-1093.42 362,-1065.42 8,-1065.42"/>
-<text text-anchor="start" x="69" y="-1076.62" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">partitioned_asset_key_log</text>
-<polygon fill="none" stroke="black" points="8,-1040.42 8,-1065.42 362,-1065.42 362,-1040.42 8,-1040.42"/>
-<text text-anchor="start" x="13" y="-1050.22" font-family="Helvetica,sans-Serif" text-decoration="underline" font-size="14.00">id</text>
-<text text-anchor="start" x="26" y="-1050.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="31" y="-1050.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
-<text text-anchor="start" x="108" y="-1050.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
-<polygon fill="none" stroke="black" points="8,-1015.42 8,-1040.42 362,-1040.42 362,-1015.42 8,-1015.42"/>
-<text text-anchor="start" x="13" y="-1025.22" font-family="Helvetica,sans-Serif" font-size="14.00">asset_event_id</text>
-<text text-anchor="start" x="116" y="-1025.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="121" y="-1025.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
-<text text-anchor="start" x="198" y="-1025.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
-<polygon fill="none" stroke="black" points="8,-990.42 8,-1015.42 362,-1015.42 362,-990.42 8,-990.42"/>
-<text text-anchor="start" x="13" y="-1000.22" font-family="Helvetica,sans-Serif" font-size="14.00">asset_id</text>
-<text text-anchor="start" x="70" y="-1000.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="75" y="-1000.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
-<text text-anchor="start" x="152" y="-1000.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
-<polygon fill="none" stroke="black" points="8,-965.42 8,-990.42 362,-990.42 362,-965.42 8,-965.42"/>
-<text text-anchor="start" x="13" y="-975.22" font-family="Helvetica,sans-Serif" font-size="14.00">asset_partition_dag_run_id</text>
-<text text-anchor="start" x="199" y="-975.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="204" y="-975.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
-<text text-anchor="start" x="281" y="-975.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
-<polygon fill="none" stroke="black" points="8,-940.42 8,-965.42 362,-965.42 362,-940.42 8,-940.42"/>
-<text text-anchor="start" x="13" y="-950.22" font-family="Helvetica,sans-Serif" font-size="14.00">created_at</text>
-<text text-anchor="start" x="86" y="-950.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="91" y="-950.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TIMESTAMP]</text>
-<text text-anchor="start" x="187" y="-950.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
-<polygon fill="none" stroke="black" points="8,-915.42 8,-940.42 362,-940.42 362,-915.42 8,-915.42"/>
-<text text-anchor="start" x="13" y="-925.22" font-family="Helvetica,sans-Serif" font-size="14.00">source_partition_key</text>
-<text text-anchor="start" x="155" y="-925.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="160" y="-925.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
-<text text-anchor="start" x="281" y="-925.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
-<polygon fill="none" stroke="black" points="8,-890.42 8,-915.42 362,-915.42 362,-890.42 8,-890.42"/>
-<text text-anchor="start" x="13" y="-900.22" font-family="Helvetica,sans-Serif" font-size="14.00">target_dag_id</text>
-<text text-anchor="start" x="107" y="-900.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="112" y="-900.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
-<text text-anchor="start" x="233" y="-900.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
-<polygon fill="none" stroke="black" points="8,-865.42 8,-890.42 362,-890.42 362,-865.42 8,-865.42"/>
-<text text-anchor="start" x="13" y="-875.22" font-family="Helvetica,sans-Serif" font-size="14.00">target_partition_key</text>
-<text text-anchor="start" x="151" y="-875.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="156" y="-875.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
-<text text-anchor="start" x="277" y="-875.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="8,-1091.42 8,-1119.42 362,-1119.42 362,-1091.42 8,-1091.42"/>
+<text text-anchor="start" x="69" y="-1102.62" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">partitioned_asset_key_log</text>
+<polygon fill="none" stroke="black" points="8,-1066.42 8,-1091.42 362,-1091.42 362,-1066.42 8,-1066.42"/>
+<text text-anchor="start" x="13" y="-1076.22" font-family="Helvetica,sans-Serif" text-decoration="underline" font-size="14.00">id</text>
+<text text-anchor="start" x="26" y="-1076.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="31" y="-1076.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
+<text text-anchor="start" x="108" y="-1076.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="8,-1041.42 8,-1066.42 362,-1066.42 362,-1041.42 8,-1041.42"/>
+<text text-anchor="start" x="13" y="-1051.22" font-family="Helvetica,sans-Serif" font-size="14.00">asset_event_id</text>
+<text text-anchor="start" x="116" y="-1051.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="121" y="-1051.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
+<text text-anchor="start" x="198" y="-1051.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="8,-1016.42 8,-1041.42 362,-1041.42 362,-1016.42 8,-1016.42"/>
+<text text-anchor="start" x="13" y="-1026.22" font-family="Helvetica,sans-Serif" font-size="14.00">asset_id</text>
+<text text-anchor="start" x="70" y="-1026.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="75" y="-1026.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
+<text text-anchor="start" x="152" y="-1026.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="8,-991.42 8,-1016.42 362,-1016.42 362,-991.42 8,-991.42"/>
+<text text-anchor="start" x="13" y="-1001.22" font-family="Helvetica,sans-Serif" font-size="14.00">asset_partition_dag_run_id</text>
+<text text-anchor="start" x="199" y="-1001.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="204" y="-1001.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
+<text text-anchor="start" x="281" y="-1001.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="8,-966.42 8,-991.42 362,-991.42 362,-966.42 8,-966.42"/>
+<text text-anchor="start" x="13" y="-976.22" font-family="Helvetica,sans-Serif" font-size="14.00">created_at</text>
+<text text-anchor="start" x="86" y="-976.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="91" y="-976.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TIMESTAMP]</text>
+<text text-anchor="start" x="187" y="-976.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="8,-941.42 8,-966.42 362,-966.42 362,-941.42 8,-941.42"/>
+<text text-anchor="start" x="13" y="-951.22" font-family="Helvetica,sans-Serif" font-size="14.00">source_partition_key</text>
+<text text-anchor="start" x="155" y="-951.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="160" y="-951.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
+<text text-anchor="start" x="281" y="-951.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="8,-916.42 8,-941.42 362,-941.42 362,-916.42 8,-916.42"/>
+<text text-anchor="start" x="13" y="-926.22" font-family="Helvetica,sans-Serif" font-size="14.00">target_dag_id</text>
+<text text-anchor="start" x="107" y="-926.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="112" y="-926.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
+<text text-anchor="start" x="233" y="-926.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="8,-891.42 8,-916.42 362,-916.42 362,-891.42 8,-891.42"/>
+<text text-anchor="start" x="13" y="-901.22" font-family="Helvetica,sans-Serif" font-size="14.00">target_partition_key</text>
+<text text-anchor="start" x="151" y="-901.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="156" y="-901.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
+<text text-anchor="start" x="277" y="-901.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
 </g>
 <!-- import_error -->
 <g id="node5" class="node">
 <title>import_error</title>
-<polygon fill="none" stroke="black" points="70,-1244.42 70,-1272.42 300,-1272.42 300,-1244.42 70,-1244.42"/>
-<text text-anchor="start" x="127.5" y="-1255.62" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">import_error</text>
-<polygon fill="none" stroke="black" points="70,-1219.42 70,-1244.42 300,-1244.42 300,-1219.42 70,-1219.42"/>
-<text text-anchor="start" x="75" y="-1229.22" font-family="Helvetica,sans-Serif" text-decoration="underline" font-size="14.00">id</text>
-<text text-anchor="start" x="88" y="-1229.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="93" y="-1229.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
-<text text-anchor="start" x="170" y="-1229.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
-<polygon fill="none" stroke="black" points="70,-1194.42 70,-1219.42 300,-1219.42 300,-1194.42 70,-1194.42"/>
-<text text-anchor="start" x="75" y="-1204.22" font-family="Helvetica,sans-Serif" font-size="14.00">bundle_name</text>
-<text text-anchor="start" x="169" y="-1204.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="174" y="-1204.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
-<polygon fill="none" stroke="black" points="70,-1169.42 70,-1194.42 300,-1194.42 300,-1169.42 70,-1169.42"/>
-<text text-anchor="start" x="75" y="-1179.22" font-family="Helvetica,sans-Serif" font-size="14.00">filename</text>
-<text text-anchor="start" x="136" y="-1179.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="141" y="-1179.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(1024)]</text>
-<polygon fill="none" stroke="black" points="70,-1144.42 70,-1169.42 300,-1169.42 300,-1144.42 70,-1144.42"/>
-<text text-anchor="start" x="75" y="-1154.22" font-family="Helvetica,sans-Serif" font-size="14.00">stacktrace</text>
-<text text-anchor="start" x="148" y="-1154.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="153" y="-1154.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TEXT]</text>
-<polygon fill="none" stroke="black" points="70,-1119.42 70,-1144.42 300,-1144.42 300,-1119.42 70,-1119.42"/>
-<text text-anchor="start" x="75" y="-1129.22" font-family="Helvetica,sans-Serif" font-size="14.00">timestamp</text>
-<text text-anchor="start" x="150" y="-1129.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="155" y="-1129.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TIMESTAMP]</text>
+<polygon fill="none" stroke="black" points="70,-1270.42 70,-1298.42 300,-1298.42 300,-1270.42 70,-1270.42"/>
+<text text-anchor="start" x="127.5" y="-1281.62" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">import_error</text>
+<polygon fill="none" stroke="black" points="70,-1245.42 70,-1270.42 300,-1270.42 300,-1245.42 70,-1245.42"/>
+<text text-anchor="start" x="75" y="-1255.22" font-family="Helvetica,sans-Serif" text-decoration="underline" font-size="14.00">id</text>
+<text text-anchor="start" x="88" y="-1255.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="93" y="-1255.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
+<text text-anchor="start" x="170" y="-1255.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="70,-1220.42 70,-1245.42 300,-1245.42 300,-1220.42 70,-1220.42"/>
+<text text-anchor="start" x="75" y="-1230.22" font-family="Helvetica,sans-Serif" font-size="14.00">bundle_name</text>
+<text text-anchor="start" x="169" y="-1230.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="174" y="-1230.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
+<polygon fill="none" stroke="black" points="70,-1195.42 70,-1220.42 300,-1220.42 300,-1195.42 70,-1195.42"/>
+<text text-anchor="start" x="75" y="-1205.22" font-family="Helvetica,sans-Serif" font-size="14.00">filename</text>
+<text text-anchor="start" x="136" y="-1205.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="141" y="-1205.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(1024)]</text>
+<polygon fill="none" stroke="black" points="70,-1170.42 70,-1195.42 300,-1195.42 300,-1170.42 70,-1170.42"/>
+<text text-anchor="start" x="75" y="-1180.22" font-family="Helvetica,sans-Serif" font-size="14.00">stacktrace</text>
+<text text-anchor="start" x="148" y="-1180.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="153" y="-1180.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TEXT]</text>
+<polygon fill="none" stroke="black" points="70,-1145.42 70,-1170.42 300,-1170.42 300,-1145.42 70,-1145.42"/>
+<text text-anchor="start" x="75" y="-1155.22" font-family="Helvetica,sans-Serif" font-size="14.00">timestamp</text>
+<text text-anchor="start" x="150" y="-1155.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="155" y="-1155.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TIMESTAMP]</text>
 </g>
 <!-- dag_bundle -->
 <g id="node6" class="node">
@@ -247,13 +247,13 @@
 <text text-anchor="start" x="621" y="-1753.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
 <text text-anchor="start" x="742" y="-1753.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
 <polygon fill="none" stroke="black" points="484,-1718.42 484,-1743.42 823,-1743.42 823,-1718.42 484,-1718.42"/>
-<text text-anchor="start" x="489" y="-1728.22" font-family="Helvetica,sans-Serif" text-decoration="underline" font-size="14.00">team_id</text>
-<text text-anchor="start" x="544" y="-1728.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="549" y="-1728.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [UUID]</text>
-<text text-anchor="start" x="601" y="-1728.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<text text-anchor="start" x="489" y="-1728.22" font-family="Helvetica,sans-Serif" text-decoration="underline" font-size="14.00">team_name</text>
+<text text-anchor="start" x="571" y="-1728.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="576" y="-1728.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(50)]</text>
+<text text-anchor="start" x="688" y="-1728.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
 </g>
 <!-- dag_bundle&#45;&#45;dag_bundle_team -->
-<g id="edge2" class="edge">
+<g id="edge1" class="edge">
 <title>dag_bundle:name&#45;&#45;dag_bundle_team:dag_bundle_name</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M325,-1979.42C446.83,-1979.42 361.17,-1755.42 483,-1755.42"/>
 <text text-anchor="start" x="452" y="-1744.22" font-family="Times,serif" font-size="14.00">0..N</text>
@@ -392,19 +392,14 @@
 <polygon fill="none" stroke="black" points="64,-1349.42 64,-1377.42 307,-1377.42 307,-1349.42 64,-1349.42"/>
 <text text-anchor="start" x="162.5" y="-1360.62" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">team</text>
 <polygon fill="none" stroke="black" points="64,-1324.42 64,-1349.42 307,-1349.42 307,-1324.42 64,-1324.42"/>
-<text text-anchor="start" x="69" y="-1334.22" font-family="Helvetica,sans-Serif" text-decoration="underline" font-size="14.00">id</text>
-<text text-anchor="start" x="82" y="-1334.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="87" y="-1334.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [UUID]</text>
-<text text-anchor="start" x="139" y="-1334.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
-<polygon fill="none" stroke="black" points="64,-1299.42 64,-1324.42 307,-1324.42 307,-1299.42 64,-1299.42"/>
-<text text-anchor="start" x="69" y="-1309.22" font-family="Helvetica,sans-Serif" font-size="14.00">name</text>
-<text text-anchor="start" x="109" y="-1309.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="114" y="-1309.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(50)]</text>
-<text text-anchor="start" x="226" y="-1309.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<text text-anchor="start" x="69" y="-1334.22" font-family="Helvetica,sans-Serif" text-decoration="underline" font-size="14.00">name</text>
+<text text-anchor="start" x="109" y="-1334.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="114" y="-1334.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(50)]</text>
+<text text-anchor="start" x="226" y="-1334.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
 </g>
 <!-- team&#45;&#45;dag_bundle_team -->
-<g id="edge1" class="edge">
-<title>team:id&#45;&#45;dag_bundle_team:team_id</title>
+<g id="edge2" class="edge">
+<title>team:name&#45;&#45;dag_bundle_team:team_name</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M308,-1336.42C499.61,-1336.42 291.39,-1730.42 483,-1730.42"/>
 <text text-anchor="start" x="452" y="-1719.22" font-family="Times,serif" font-size="14.00">0..N</text>
 <text text-anchor="start" x="308" y="-1325.22" font-family="Times,serif" font-size="14.00">1</text>
@@ -466,13 +461,13 @@
 <text text-anchor="start" x="571" y="-1170.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
 <text text-anchor="start" x="576" y="-1170.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(500)]</text>
 <polygon fill="none" stroke="black" points="511,-1135.42 511,-1160.42 795,-1160.42 795,-1135.42 511,-1135.42"/>
-<text text-anchor="start" x="516" y="-1145.22" font-family="Helvetica,sans-Serif" font-size="14.00">team_id</text>
-<text text-anchor="start" x="571" y="-1145.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="576" y="-1145.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [UUID]</text>
+<text text-anchor="start" x="516" y="-1145.22" font-family="Helvetica,sans-Serif" font-size="14.00">team_name</text>
+<text text-anchor="start" x="598" y="-1145.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="603" y="-1145.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(50)]</text>
 </g>
 <!-- team&#45;&#45;connection -->
 <g id="edge4" class="edge">
-<title>team:id&#45;&#45;connection:team_id</title>
+<title>team:name&#45;&#45;connection:team_name</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M308,-1336.42C430.95,-1336.42 387.05,-1147.42 510,-1147.42"/>
 <text text-anchor="start" x="479" y="-1136.22" font-family="Times,serif" font-size="14.00">0..N</text>
 <text text-anchor="start" x="308" y="-1340.22" font-family="Times,serif" font-size="14.00">{0,1}</text>
@@ -480,39 +475,39 @@
 <!-- variable -->
 <g id="node19" class="node">
 <title>variable</title>
-<polygon fill="none" stroke="black" points="559,-1082.42 559,-1110.42 747,-1110.42 747,-1082.42 559,-1082.42"/>
-<text text-anchor="start" x="616.5" y="-1093.62" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">variable</text>
-<polygon fill="none" stroke="black" points="559,-1057.42 559,-1082.42 747,-1082.42 747,-1057.42 559,-1057.42"/>
-<text text-anchor="start" x="564" y="-1067.22" font-family="Helvetica,sans-Serif" text-decoration="underline" font-size="14.00">id</text>
-<text text-anchor="start" x="577" y="-1067.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="582" y="-1067.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
-<text text-anchor="start" x="659" y="-1067.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
-<polygon fill="none" stroke="black" points="559,-1032.42 559,-1057.42 747,-1057.42 747,-1032.42 559,-1032.42"/>
-<text text-anchor="start" x="564" y="-1042.22" font-family="Helvetica,sans-Serif" font-size="14.00">description</text>
-<text text-anchor="start" x="642" y="-1042.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="647" y="-1042.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TEXT]</text>
-<polygon fill="none" stroke="black" points="559,-1007.42 559,-1032.42 747,-1032.42 747,-1007.42 559,-1007.42"/>
-<text text-anchor="start" x="564" y="-1017.22" font-family="Helvetica,sans-Serif" font-size="14.00">is_encrypted</text>
-<text text-anchor="start" x="653" y="-1017.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="658" y="-1017.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [BOOLEAN]</text>
-<polygon fill="none" stroke="black" points="559,-982.42 559,-1007.42 747,-1007.42 747,-982.42 559,-982.42"/>
-<text text-anchor="start" x="564" y="-992.22" font-family="Helvetica,sans-Serif" font-size="14.00">key</text>
-<text text-anchor="start" x="589" y="-992.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="594" y="-992.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
-<polygon fill="none" stroke="black" points="559,-957.42 559,-982.42 747,-982.42 747,-957.42 559,-957.42"/>
-<text text-anchor="start" x="564" y="-967.22" font-family="Helvetica,sans-Serif" font-size="14.00">team_id</text>
-<text text-anchor="start" x="619" y="-967.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="624" y="-967.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [UUID]</text>
-<polygon fill="none" stroke="black" points="559,-932.42 559,-957.42 747,-957.42 747,-932.42 559,-932.42"/>
-<text text-anchor="start" x="564" y="-942.22" font-family="Helvetica,sans-Serif" font-size="14.00">val</text>
-<text text-anchor="start" x="585" y="-942.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="590" y="-942.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TEXT]</text>
+<polygon fill="none" stroke="black" points="549,-1082.42 549,-1110.42 758,-1110.42 758,-1082.42 549,-1082.42"/>
+<text text-anchor="start" x="617" y="-1093.62" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">variable</text>
+<polygon fill="none" stroke="black" points="549,-1057.42 549,-1082.42 758,-1082.42 758,-1057.42 549,-1057.42"/>
+<text text-anchor="start" x="554" y="-1067.22" font-family="Helvetica,sans-Serif" text-decoration="underline" font-size="14.00">id</text>
+<text text-anchor="start" x="567" y="-1067.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="572" y="-1067.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
+<text text-anchor="start" x="649" y="-1067.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="549,-1032.42 549,-1057.42 758,-1057.42 758,-1032.42 549,-1032.42"/>
+<text text-anchor="start" x="554" y="-1042.22" font-family="Helvetica,sans-Serif" font-size="14.00">description</text>
+<text text-anchor="start" x="632" y="-1042.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="637" y="-1042.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TEXT]</text>
+<polygon fill="none" stroke="black" points="549,-1007.42 549,-1032.42 758,-1032.42 758,-1007.42 549,-1007.42"/>
+<text text-anchor="start" x="554" y="-1017.22" font-family="Helvetica,sans-Serif" font-size="14.00">is_encrypted</text>
+<text text-anchor="start" x="643" y="-1017.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="648" y="-1017.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [BOOLEAN]</text>
+<polygon fill="none" stroke="black" points="549,-982.42 549,-1007.42 758,-1007.42 758,-982.42 549,-982.42"/>
+<text text-anchor="start" x="554" y="-992.22" font-family="Helvetica,sans-Serif" font-size="14.00">key</text>
+<text text-anchor="start" x="579" y="-992.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="584" y="-992.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(250)]</text>
+<polygon fill="none" stroke="black" points="549,-957.42 549,-982.42 758,-982.42 758,-957.42 549,-957.42"/>
+<text text-anchor="start" x="554" y="-967.22" font-family="Helvetica,sans-Serif" font-size="14.00">team_name</text>
+<text text-anchor="start" x="636" y="-967.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="641" y="-967.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(50)]</text>
+<polygon fill="none" stroke="black" points="549,-932.42 549,-957.42 758,-957.42 758,-932.42 549,-932.42"/>
+<text text-anchor="start" x="554" y="-942.22" font-family="Helvetica,sans-Serif" font-size="14.00">val</text>
+<text text-anchor="start" x="575" y="-942.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="580" y="-942.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TEXT]</text>
 </g>
 <!-- team&#45;&#45;variable -->
 <g id="edge13" class="edge">
-<title>team:id&#45;&#45;variable:team_id</title>
-<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M308,-1336.42C343.68,-1336.42 348.36,-1313.79 370,-1285.42 469.13,-1155.5 394.58,-969.42 558,-969.42"/>
-<text text-anchor="start" x="527" y="-958.22" font-family="Times,serif" font-size="14.00">0..N</text>
+<title>team:name&#45;&#45;variable:team_name</title>
+<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M308,-1336.42C337.71,-1336.42 349.15,-1332.59 370,-1311.42 401.6,-1279.35 422.01,-1162.25 443,-1122.42 481.45,-1049.46 465.53,-969.42 548,-969.42"/>
+<text text-anchor="start" x="517" y="-958.22" font-family="Times,serif" font-size="14.00">0..N</text>
 <text text-anchor="start" x="308" y="-1325.22" font-family="Times,serif" font-size="14.00">{0,1}</text>
 </g>
 <!-- slot_pool -->
@@ -543,13 +538,13 @@
 <text text-anchor="start" x="546" y="-1549.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
 <text text-anchor="start" x="551" y="-1549.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
 <polygon fill="none" stroke="black" points="508,-1514.42 508,-1539.42 799,-1539.42 799,-1514.42 508,-1514.42"/>
-<text text-anchor="start" x="513" y="-1524.22" font-family="Helvetica,sans-Serif" font-size="14.00">team_id</text>
-<text text-anchor="start" x="568" y="-1524.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="573" y="-1524.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [UUID]</text>
+<text text-anchor="start" x="513" y="-1524.22" font-family="Helvetica,sans-Serif" font-size="14.00">team_name</text>
+<text text-anchor="start" x="595" y="-1524.22" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="600" y="-1524.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(50)]</text>
 </g>
 <!-- team&#45;&#45;slot_pool -->
 <g id="edge15" class="edge">
-<title>team:id&#45;&#45;slot_pool:team_id</title>
+<title>team:name&#45;&#45;slot_pool:team_name</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M308,-1336.42C402.75,-1336.42 366.37,-1445.7 443,-1501.42 467.7,-1519.38 476.46,-1526.42 507,-1526.42"/>
 <text text-anchor="start" x="476" y="-1515.22" font-family="Times,serif" font-size="14.00">0..N</text>
 <text text-anchor="start" x="267" y="-1325.22" font-family="Times,serif" font-size="14.00">{0,1}</text>
@@ -830,7 +825,7 @@
 <text text-anchor="start" x="1888" y="-629.22" font-family="Helvetica,sans-Serif" font-size="14.00"> [TIMESTAMP]</text>
 </g>
 <!-- trigger&#45;&#45;task_instance -->
-<g id="edge48" class="edge">
+<g id="edge47" class="edge">
 <title>trigger:id&#45;&#45;task_instance:trigger_id</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M1262.5,-1001.42C1316,-1001.42 1320.44,-965.71 1372,-951.42 1446.57,-930.76 1655.64,-958.22 1718,-912.42 1753.44,-886.39 1754.02,-731.42 1798,-731.42"/>
 <text text-anchor="start" x="1767" y="-720.22" font-family="Times,serif" font-size="14.00">0..N</text>
@@ -934,7 +929,7 @@
 <text text-anchor="start" x="1150.5" y="-556.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
 </g>
 <!-- asset_alias&#45;&#45;asset_alias_asset_event -->
-<g id="edge7" class="edge">
+<g id="edge8" class="edge">
 <title>asset_alias:id&#45;&#45;asset_alias_asset_event:alias_id</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M785,-636.42C884.93,-636.42 903.57,-583.42 1003.5,-583.42"/>
 <text text-anchor="start" x="972.5" y="-572.22" font-family="Times,serif" font-size="14.00">0..N</text>
@@ -1046,18 +1041,18 @@
 </g>
 <!-- asset&#45;&#45;asset_active -->
 <g id="edge11" class="edge">
-<title>asset:uri&#45;&#45;asset_active:uri</title>
-<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M787,-714.42C878.63,-714.42 894.87,-766.42 986.5,-766.42"/>
-<text text-anchor="start" x="976.5" y="-755.22" font-family="Times,serif" font-size="14.00">1</text>
-<text text-anchor="start" x="787" y="-703.22" font-family="Times,serif" font-size="14.00">1</text>
-</g>
-<!-- asset&#45;&#45;asset_active -->
-<g id="edge12" class="edge">
 <title>asset:name&#45;&#45;asset_active:name</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M787,-764.42C876.48,-764.42 897.02,-791.42 986.5,-791.42"/>
 <text text-anchor="start" x="976.5" y="-780.22" font-family="Times,serif" font-size="14.00">1</text>
 <text text-anchor="start" x="787" y="-753.22" font-family="Times,serif" font-size="14.00">1</text>
 </g>
+<!-- asset&#45;&#45;asset_active -->
+<g id="edge12" class="edge">
+<title>asset:uri&#45;&#45;asset_active:uri</title>
+<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M787,-714.42C878.63,-714.42 894.87,-766.42 986.5,-766.42"/>
+<text text-anchor="start" x="976.5" y="-755.22" font-family="Times,serif" font-size="14.00">1</text>
+<text text-anchor="start" x="787" y="-703.22" font-family="Times,serif" font-size="14.00">1</text>
+</g>
 <!-- dag_schedule_asset_reference -->
 <g id="node26" class="node">
 <title>dag_schedule_asset_reference</title>
@@ -1189,7 +1184,7 @@
 <text text-anchor="start" x="1143.5" y="-1273.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
 </g>
 <!-- asset&#45;&#45;asset_dag_run_queue -->
-<g id="edge27" class="edge">
+<g id="edge28" class="edge">
 <title>asset:id&#45;&#45;asset_dag_run_queue:asset_id</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M787,-865.42C828.44,-865.42 840.3,-884.76 863,-919.42 888.51,-958.39 916.92,-1326.42 963.5,-1326.42"/>
 <text text-anchor="start" x="932.5" y="-1315.22" font-family="Times,serif" font-size="14.00">0..N</text>
@@ -1242,7 +1237,7 @@
 <text text-anchor="start" x="703" y="-54.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
 </g>
 <!-- asset_event&#45;&#45;asset_alias_asset_event -->
-<g id="edge8" class="edge">
+<g id="edge7" class="edge">
 <title>asset_event:id&#45;&#45;asset_alias_asset_event:event_id</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M785,-257.42C924.82,-257.42 830.19,-442.02 936,-533.42 960.21,-554.34 971.51,-558.42 1003.5,-558.42"/>
 <text text-anchor="start" x="972.5" y="-547.22" font-family="Times,serif" font-size="14.00">0..N</text>
@@ -1402,7 +1397,7 @@
 <text text-anchor="start" x="846" y="-2489.22" font-family="Times,serif" font-size="14.00">1</text>
 </g>
 <!-- dag&#45;&#45;asset_dag_run_queue -->
-<g id="edge28" class="edge">
+<g id="edge27" class="edge">
 <title>dag:dag_id&#45;&#45;asset_dag_run_queue:target_dag_id</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M856,-2485.42C886.8,-2485.42 929.77,-1409.59 936,-1379.42 943.52,-1343.01 926.32,-1300.42 963.5,-1300.42"/>
 <text text-anchor="start" x="932.5" y="-1289.22" font-family="Times,serif" font-size="14.00">0..N</text>
@@ -1878,7 +1873,7 @@
 <text text-anchor="start" x="1988" y="-196.22" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
 </g>
 <!-- dag_run&#45;&#45;backfill_dag_run -->
-<g id="edge43" class="edge">
+<g id="edge44" class="edge">
 <title>dag_run:id&#45;&#45;backfill_dag_run:dag_run_id</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M1694,-859.42C1760.55,-859.42 1751.45,-273.42 1818,-273.42"/>
 <text text-anchor="start" x="1787" y="-262.22" font-family="Times,serif" font-size="14.00">0..N</text>
@@ -1886,18 +1881,18 @@
 </g>
 <!-- dag_run&#45;&#45;task_instance -->
 <g id="edge46" class="edge">
-<title>dag_run:run_id&#45;&#45;task_instance:run_id</title>
-<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M1694,-408.42C1807.05,-408.42 1684.95,-906.42 1798,-906.42"/>
-<text text-anchor="start" x="1767" y="-895.22" font-family="Times,serif" font-size="14.00">0..N</text>
-<text text-anchor="start" x="1694" y="-397.22" font-family="Times,serif" font-size="14.00">1</text>
-</g>
-<!-- dag_run&#45;&#45;task_instance -->
-<g id="edge47" class="edge">
 <title>dag_run:dag_id&#45;&#45;task_instance:dag_id</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M1694,-659.42C1783.42,-659.42 1708.58,-1457.42 1798,-1457.42"/>
 <text text-anchor="start" x="1767" y="-1446.22" font-family="Times,serif" font-size="14.00">0..N</text>
 <text text-anchor="start" x="1694" y="-648.22" font-family="Times,serif" font-size="14.00">1</text>
 </g>
+<!-- dag_run&#45;&#45;task_instance -->
+<g id="edge48" class="edge">
+<title>dag_run:run_id&#45;&#45;task_instance:run_id</title>
+<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M1694,-408.42C1807.05,-408.42 1684.95,-906.42 1798,-906.42"/>
+<text text-anchor="start" x="1767" y="-895.22" font-family="Times,serif" font-size="14.00">0..N</text>
+<text text-anchor="start" x="1694" y="-397.22" font-family="Times,serif" font-size="14.00">1</text>
+</g>
 <!-- dag_run_note -->
 <g id="node44" class="node">
 <title>dag_run_note</title>
@@ -2005,7 +2000,7 @@
 <text text-anchor="start" x="1292.5" y="-469.22" font-family="Times,serif" font-size="14.00">{0,1}</text>
 </g>
 <!-- backfill&#45;&#45;backfill_dag_run -->
-<g id="edge44" class="edge">
+<g id="edge43" class="edge">
 <title>backfill:id&#45;&#45;backfill_dag_run:backfill_id</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M1292.5,-480.42C1429.15,-480.42 1263.6,-266.62 1372,-183.42 1493.99,-89.79 1578.2,-119.36 1718,-183.42 1779.88,-211.78 1749.93,-299.42 1818,-299.42"/>
 <text text-anchor="start" x="1787" y="-288.22" font-family="Times,serif" font-size="14.00">0..N</text>
@@ -2119,32 +2114,32 @@
 </g>
 <!-- task_instance&#45;&#45;task_map -->
 <g id="edge51" class="edge">
+<title>task_instance:dag_id&#45;&#45;task_map:dag_id</title>
+<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-1457.42C2155.39,-1457.42 2147.65,-652.7 2151,-605.42 2163.79,-424.68 2132.71,-371.97 2188,-199.42 2196.33,-173.44 2191.71,-146.42 2219,-146.42"/>
+<text text-anchor="start" x="2188" y="-135.22" font-family="Times,serif" font-size="14.00">0..N</text>
+<text text-anchor="start" x="2108" y="-1446.22" font-family="Times,serif" font-size="14.00">1</text>
+</g>
+<!-- task_instance&#45;&#45;task_map -->
+<g id="edge52" class="edge">
 <title>task_instance:run_id&#45;&#45;task_map:run_id</title>
-<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-906.42C2155.13,-906.42 2145.58,-531.24 2151,-484.42 2165.7,-357.54 2161.45,-324.36 2188,-199.42 2198.03,-152.24 2170.77,-95.42 2219,-95.42"/>
+<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-906.42C2156.13,-906.42 2145.41,-523.22 2151,-475.42 2165.37,-352.5 2162.02,-320.43 2188,-199.42 2198.12,-152.27 2170.77,-95.42 2219,-95.42"/>
 <text text-anchor="start" x="2188" y="-84.22" font-family="Times,serif" font-size="14.00">0..N</text>
 <text text-anchor="start" x="2108" y="-895.22" font-family="Times,serif" font-size="14.00">1</text>
 </g>
 <!-- task_instance&#45;&#45;task_map -->
-<g id="edge52" class="edge">
+<g id="edge53" class="edge">
 <title>task_instance:task_id&#45;&#45;task_map:task_id</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-756.42C2141.78,-756.42 2146.19,-488.86 2151,-455.42 2167.35,-341.63 2166.32,-312.32 2188,-199.42 2199.12,-141.51 2160.03,-70.42 2219,-70.42"/>
 <text text-anchor="start" x="2188" y="-59.22" font-family="Times,serif" font-size="14.00">0..N</text>
 <text text-anchor="start" x="2108" y="-745.22" font-family="Times,serif" font-size="14.00">1</text>
 </g>
 <!-- task_instance&#45;&#45;task_map -->
-<g id="edge53" class="edge">
+<g id="edge54" class="edge">
 <title>task_instance:map_index&#45;&#45;task_map:map_index</title>
-<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-1232.42C2146.96,-1232.42 2147.65,-571.24 2151,-532.42 2154.98,-486.31 2172.71,-121.42 2219,-121.42"/>
+<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-1232.42C2143.69,-1232.42 2148.13,-627 2151,-591.42 2165.08,-416.99 2147.05,-369.56 2188,-199.42 2196.73,-163.15 2181.7,-121.42 2219,-121.42"/>
 <text text-anchor="start" x="2188" y="-110.22" font-family="Times,serif" font-size="14.00">0..N</text>
 <text text-anchor="start" x="2108" y="-1221.22" font-family="Times,serif" font-size="14.00">1</text>
 </g>
-<!-- task_instance&#45;&#45;task_map -->
-<g id="edge54" class="edge">
-<title>task_instance:dag_id&#45;&#45;task_map:dag_id</title>
-<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-1457.42C2155.39,-1457.42 2147.65,-652.7 2151,-605.42 2163.79,-424.68 2132.71,-371.97 2188,-199.42 2196.33,-173.44 2191.71,-146.42 2219,-146.42"/>
-<text text-anchor="start" x="2188" y="-135.22" font-family="Times,serif" font-size="14.00">0..N</text>
-<text text-anchor="start" x="2108" y="-1446.22" font-family="Times,serif" font-size="14.00">1</text>
-</g>
 <!-- task_reschedule -->
 <g id="node47" class="node">
 <title>task_reschedule</title>
@@ -2235,10 +2230,10 @@
 </g>
 <!-- task_instance&#45;&#45;xcom -->
 <g id="edge56" class="edge">
-<title>task_instance:task_id&#45;&#45;xcom:task_id</title>
-<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-756.42C2144.65,-756.42 2146.16,-1047.1 2151,-1083.42 2167.23,-1205.23 2165.41,-1236.63 2188,-1357.42 2198.5,-1413.58 2160.87,-1482.42 2218,-1482.42"/>
-<text text-anchor="start" x="2187" y="-1471.22" font-family="Times,serif" font-size="14.00">0..N</text>
-<text text-anchor="start" x="2108" y="-760.22" font-family="Times,serif" font-size="14.00">1</text>
+<title>task_instance:run_id&#45;&#45;xcom:run_id</title>
+<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-906.42C2167.71,-906.42 2158.29,-1432.42 2218,-1432.42"/>
+<text text-anchor="start" x="2187" y="-1421.22" font-family="Times,serif" font-size="14.00">0..N</text>
+<text text-anchor="start" x="2108" y="-910.22" font-family="Times,serif" font-size="14.00">1</text>
 </g>
 <!-- task_instance&#45;&#45;xcom -->
 <g id="edge57" class="edge">
@@ -2256,10 +2251,10 @@
 </g>
 <!-- task_instance&#45;&#45;xcom -->
 <g id="edge59" class="edge">
-<title>task_instance:run_id&#45;&#45;xcom:run_id</title>
-<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-906.42C2167.71,-906.42 2158.29,-1432.42 2218,-1432.42"/>
-<text text-anchor="start" x="2187" y="-1421.22" font-family="Times,serif" font-size="14.00">0..N</text>
-<text text-anchor="start" x="2108" y="-910.22" font-family="Times,serif" font-size="14.00">1</text>
+<title>task_instance:task_id&#45;&#45;xcom:task_id</title>
+<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-756.42C2144.65,-756.42 2146.16,-1047.1 2151,-1083.42 2167.23,-1205.23 2165.41,-1236.63 2188,-1357.42 2198.5,-1413.58 2160.87,-1482.42 2218,-1482.42"/>
+<text text-anchor="start" x="2187" y="-1471.22" font-family="Times,serif" font-size="14.00">0..N</text>
+<text text-anchor="start" x="2108" y="-760.22" font-family="Times,serif" font-size="14.00">1</text>
 </g>
 <!-- task_instance_note -->
 <g id="node49" class="node">
@@ -2458,26 +2453,26 @@
 </g>
 <!-- task_instance&#45;&#45;task_instance_history -->
 <g id="edge61" class="edge">
+<title>task_instance:dag_id&#45;&#45;task_instance_history:dag_id</title>
+<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-1457.42C2191.66,-1457.42 2119.83,-1161.06 2151,-1083.42 2163.05,-1053.4 2162.64,-1025.42 2195,-1025.42"/>
+<text text-anchor="start" x="2164" y="-1014.22" font-family="Times,serif" font-size="14.00">0..N</text>
+<text text-anchor="start" x="2098" y="-1446.22" font-family="Times,serif" font-size="14.00">1</text>
+</g>
+<!-- task_instance&#45;&#45;task_instance_history -->
+<g id="edge62" class="edge">
 <title>task_instance:map_index&#45;&#45;task_instance_history:map_index</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-1232.42C2178.21,-1232.42 2131.11,-986.76 2151,-919.42 2164.06,-875.18 2148.87,-825.42 2195,-825.42"/>
 <text text-anchor="start" x="2164" y="-814.22" font-family="Times,serif" font-size="14.00">0..N</text>
 <text text-anchor="start" x="2098" y="-1221.22" font-family="Times,serif" font-size="14.00">1</text>
 </g>
 <!-- task_instance&#45;&#45;task_instance_history -->
-<g id="edge62" class="edge">
+<g id="edge63" class="edge">
 <title>task_instance:task_id&#45;&#45;task_instance_history:task_id</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-756.42C2200.49,-756.42 2102.51,-349.42 2195,-349.42"/>
 <text text-anchor="start" x="2164" y="-338.22" font-family="Times,serif" font-size="14.00">0..N</text>
 <text text-anchor="start" x="2098" y="-745.22" font-family="Times,serif" font-size="14.00">1</text>
 </g>
 <!-- task_instance&#45;&#45;task_instance_history -->
-<g id="edge63" class="edge">
-<title>task_instance:dag_id&#45;&#45;task_instance_history:dag_id</title>
-<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-1457.42C2191.66,-1457.42 2119.83,-1161.06 2151,-1083.42 2163.05,-1053.4 2162.64,-1025.42 2195,-1025.42"/>
-<text text-anchor="start" x="2164" y="-1014.22" font-family="Times,serif" font-size="14.00">0..N</text>
-<text text-anchor="start" x="2098" y="-1446.22" font-family="Times,serif" font-size="14.00">1</text>
-</g>
-<!-- task_instance&#45;&#45;task_instance_history -->
 <g id="edge64" class="edge">
 <title>task_instance:run_id&#45;&#45;task_instance_history:run_id</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-906.42C2200.49,-906.42 2102.51,-499.42 2195,-499.42"/>
@@ -2521,10 +2516,10 @@
 </g>
 <!-- task_instance&#45;&#45;rendered_task_instance_fields -->
 <g id="edge65" class="edge">
-<title>task_instance:task_id&#45;&#45;rendered_task_instance_fields:task_id</title>
-<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-756.42C2161.63,-756.42 2155.37,-1228.42 2209,-1228.42"/>
-<text text-anchor="start" x="2178" y="-1217.22" font-family="Times,serif" font-size="14.00">0..N</text>
-<text text-anchor="start" x="2098" y="-760.22" font-family="Times,serif" font-size="14.00">1</text>
+<title>task_instance:dag_id&#45;&#45;rendered_task_instance_fields:dag_id</title>
+<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-1457.42C2152.33,-1457.42 2126.16,-1404.14 2151,-1367.42 2172.33,-1335.9 2170.94,-1304.42 2209,-1304.42"/>
+<text text-anchor="start" x="2178" y="-1293.22" font-family="Times,serif" font-size="14.00">0..N</text>
+<text text-anchor="start" x="2098" y="-1461.22" font-family="Times,serif" font-size="14.00">1</text>
 </g>
 <!-- task_instance&#45;&#45;rendered_task_instance_fields -->
 <g id="edge66" class="edge">
@@ -2535,18 +2530,18 @@
 </g>
 <!-- task_instance&#45;&#45;rendered_task_instance_fields -->
 <g id="edge67" class="edge">
+<title>task_instance:task_id&#45;&#45;rendered_task_instance_fields:task_id</title>
+<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-756.42C2161.63,-756.42 2155.37,-1228.42 2209,-1228.42"/>
+<text text-anchor="start" x="2178" y="-1217.22" font-family="Times,serif" font-size="14.00">0..N</text>
+<text text-anchor="start" x="2098" y="-760.22" font-family="Times,serif" font-size="14.00">1</text>
+</g>
+<!-- task_instance&#45;&#45;rendered_task_instance_fields -->
+<g id="edge68" class="edge">
 <title>task_instance:map_index&#45;&#45;rendered_task_instance_fields:map_index</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-1232.42C2157.51,-1232.42 2159.49,-1279.42 2209,-1279.42"/>
 <text text-anchor="start" x="2178" y="-1268.22" font-family="Times,serif" font-size="14.00">0..N</text>
 <text text-anchor="start" x="2098" y="-1236.22" font-family="Times,serif" font-size="14.00">1</text>
 </g>
-<!-- task_instance&#45;&#45;rendered_task_instance_fields -->
-<g id="edge68" class="edge">
-<title>task_instance:dag_id&#45;&#45;rendered_task_instance_fields:dag_id</title>
-<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2108,-1457.42C2152.33,-1457.42 2126.16,-1404.14 2151,-1367.42 2172.33,-1335.9 2170.94,-1304.42 2209,-1304.42"/>
-<text text-anchor="start" x="2178" y="-1293.22" font-family="Times,serif" font-size="14.00">0..N</text>
-<text text-anchor="start" x="2098" y="-1461.22" font-family="Times,serif" font-size="14.00">1</text>
-</g>
 <!-- hitl_detail_history -->
 <g id="node52" class="node">
 <title>hitl_detail_history</title>
diff --git a/airflow-core/docs/migrations-ref.rst b/airflow-core/docs/migrations-ref.rst
index d07187df41585..6157bc6a18250 100644
--- a/airflow-core/docs/migrations-ref.rst
+++ b/airflow-core/docs/migrations-ref.rst
@@ -39,7 +39,10 @@ Here's the list of all the Database Migrations that are executed via when you ru
 +-------------------------+------------------+-------------------+--------------------------------------------------------------+
 | Revision ID             | Revises ID       | Airflow Version   | Description                                                  |
 +=========================+==================+===================+==============================================================+
-| ``665854ef0536`` (head) | ``e812941398f4`` | ``3.2.0``         | Update ORM for asset partitioning.                           |
+| ``b12d4f98a91e`` (head) | ``665854ef0536`` | ``3.1.0``         | Drop ``id`` column from ``team`` table and make ``name`` the |
+|                         |                  |                   | primary key.                                                 |
++-------------------------+------------------+-------------------+--------------------------------------------------------------+
+| ``665854ef0536``        | ``e812941398f4`` | ``3.2.0``         | Update ORM for asset partitioning.                           |
 +-------------------------+------------------+-------------------+--------------------------------------------------------------+
 | ``e812941398f4``        | ``b87d2135fa50`` | ``3.2.0``         | Replace deadline's inline callback fields with foreign key   |
 |                         |                  |                   | to callback table.                                           |
diff --git a/airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py b/airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py
index 97e5cb4310a58..a06f3799a4654 100644
--- a/airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py
+++ b/airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py
@@ -463,7 +463,7 @@ def get_authorized_connections(
         :param method: the method to filter on
         :param session: the session
         """
-        stmt = select(Connection.conn_id, Team.name).join(Team, Connection.team_id == Team.id, isouter=True)
+        stmt = select(Connection.conn_id, Connection.team_name)
         rows = session.execute(stmt).all()
         connections_by_team: dict[str | None, set[str]] = defaultdict(set)
         for conn_id, team_name in rows:
@@ -524,14 +524,13 @@ def get_authorized_dag_ids(
         :param session: the session
         """
         stmt = (
-            select(DagModel.dag_id, Team.name)
+            select(DagModel.dag_id, dag_bundle_team_association_table.c.team_name)
             .join(DagBundleModel, DagModel.bundle_name == DagBundleModel.name)
             .join(
                 dag_bundle_team_association_table,
                 DagBundleModel.name == dag_bundle_team_association_table.c.dag_bundle_name,
                 isouter=True,
             )
-            .join(Team, Team.id == dag_bundle_team_association_table.c.team_id, isouter=True)
         )
         rows = session.execute(stmt).all()
         dags_by_team: dict[str | None, set[str]] = defaultdict(set)
@@ -592,7 +591,7 @@ def get_authorized_pools(
         :param method: the method to filter on
         :param session: the session
         """
-        stmt = select(Pool.pool, Team.name).join(Team, Pool.team_id == Team.id, isouter=True)
+        stmt = select(Pool.pool, Pool.team_name)
         rows = session.execute(stmt).all()
         pools_by_team: dict[str | None, set[str]] = defaultdict(set)
         for pool_name, team_name in rows:
@@ -652,8 +651,8 @@ def get_authorized_teams(
         :param method: the method to filter on
         :param session: the session
         """
-        teams = Team.get_all_teams_id_to_name_mapping(session=session)
-        return self.filter_authorized_teams(teams_names=set(teams.values()), user=user, method=method)
+        team_names = Team.get_all_team_names(session=session)
+        return self.filter_authorized_teams(teams_names=team_names, user=user, method=method)
 
     def filter_authorized_teams(
         self,
@@ -694,7 +693,7 @@ def get_authorized_variables(
         :param method: the method to filter on
         :param session: the session
         """
-        stmt = select(Variable.key, Team.name).join(Team, Variable.team_id == Team.id, isouter=True)
+        stmt = select(Variable.key, Variable.team_name)
         rows = session.execute(stmt).all()
         variables_by_team: dict[str | None, set[str]] = defaultdict(set)
         for var_key, team_name in rows:
diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/teams.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/teams.py
index dc4b99bc45adf..4ae1565b167cd 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/teams.py
+++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/teams.py
@@ -16,15 +16,12 @@
 # under the License.
 from __future__ import annotations
 
-from uuid import UUID
-
 from airflow.api_fastapi.core_api.base import BaseModel
 
 
 class TeamResponse(BaseModel):
     """Base serializer for Team."""
 
-    id: UUID
     name: str
 
 
diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/variables.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/variables.py
index ec2292f6ef32b..bc19207c29cdf 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/variables.py
+++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/variables.py
@@ -19,7 +19,6 @@
 
 import json
 from collections.abc import Iterable
-from uuid import UUID
 
 from pydantic import Field, JsonValue, model_validator
 
@@ -36,7 +35,7 @@ class VariableResponse(BaseModel):
     val: str = Field(alias="value")
     description: str | None
     is_encrypted: bool
-    team_id: UUID | None
+    team_name: str | None
 
     @model_validator(mode="after")
     def redact_val(self) -> Self:
@@ -59,7 +58,7 @@ class VariableBody(StrictBaseModel):
     key: str = Field(max_length=ID_LEN)
     value: JsonValue = Field(serialization_alias="val")
     description: str | None = Field(default=None)
-    team_id: UUID | None = Field(default=None)
+    team_name: str | None = Field(max_length=50, default=None)
 
 
 class VariableCollectionResponse(BaseModel):
diff --git a/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml b/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml
index cd1c666a59209..ac7f962d3c150 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml
+++ b/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml
@@ -1075,12 +1075,12 @@ paths:
           items:
             type: string
           description: 'Attributes to order by, multi criteria sort is supported.
-            Prefix with `-` for descending order. Supported attributes: `id`'
+            Prefix with `-` for descending order. Supported attributes: `name`'
           default:
-          - id
+          - name
           title: Order By
         description: 'Attributes to order by, multi criteria sort is supported. Prefix
-          with `-` for descending order. Supported attributes: `id`'
+          with `-` for descending order. Supported attributes: `name`'
       responses:
         '200':
           description: Successful Response
@@ -2642,16 +2642,11 @@ components:
       description: Team collection serializer for responses.
     TeamResponse:
       properties:
-        id:
-          type: string
-          format: uuid
-          title: Id
         name:
           type: string
           title: Name
       type: object
       required:
-      - id
       - name
       title: TeamResponse
       description: Base serializer for Team.
diff --git a/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml b/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml
index d1ed9ba9f3e0e..d3d4ca3976e26 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml
+++ b/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml
@@ -13065,12 +13065,12 @@ components:
           - type: string
           - type: 'null'
           title: Description
-        team_id:
+        team_name:
           anyOf:
           - type: string
-            format: uuid
+            maxLength: 50
           - type: 'null'
-          title: Team Id
+          title: Team Name
       additionalProperties: false
       type: object
       required:
@@ -13110,19 +13110,18 @@ components:
         is_encrypted:
           type: boolean
           title: Is Encrypted
-        team_id:
+        team_name:
           anyOf:
           - type: string
-            format: uuid
           - type: 'null'
-          title: Team Id
+          title: Team Name
       type: object
       required:
       - key
       - value
       - description
       - is_encrypted
-      - team_id
+      - team_name
       title: VariableResponse
       description: Variable serializer for responses.
     VersionInfo:
diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/teams.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/teams.py
index 61fca3d707cfd..32cc975e96ac9 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/teams.py
+++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/teams.py
@@ -48,7 +48,7 @@ def list_teams(
     offset: QueryOffset,
     order_by: Annotated[
         SortParam,
-        Depends(SortParam(["id"], Team).dynamic_depends()),
+        Depends(SortParam(["name"], Team).dynamic_depends()),
     ],
     readable_teams_filter: ReadableTeamsFilterDep,
     session: SessionDep,
diff --git a/airflow-core/src/airflow/cli/commands/team_command.py b/airflow-core/src/airflow/cli/commands/team_command.py
index fd07f5e3bf617..6a187483bc36a 100644
--- a/airflow-core/src/airflow/cli/commands/team_command.py
+++ b/airflow-core/src/airflow/cli/commands/team_command.py
@@ -40,7 +40,6 @@ def _show_teams(teams, output):
         data=teams,
         output=output,
         mapper=lambda x: {
-            "id": str(x.id),
             "name": x.name,
         },
     )
@@ -71,7 +70,7 @@ def team_create(args, session=NEW_SESSION):
     try:
         session.add(new_team)
         session.commit()
-        print(f"Team '{team_name}' created successfully with ID: {new_team.id}")
+        print(f"Team '{team_name}' created successfully.")
     except IntegrityError as e:
         session.rollback()
         raise SystemExit(f"Failed to create team '{team_name}': {e}")
@@ -96,23 +95,25 @@ def team_delete(args, session=NEW_SESSION):
     dag_bundle_count = session.scalar(
         select(func.count())
         .select_from(dag_bundle_team_association_table)
-        .where(dag_bundle_team_association_table.c.team_id == team.id)
+        .where(dag_bundle_team_association_table.c.team_name == team.name)
     )
     if dag_bundle_count:
         associations.append(f"{dag_bundle_count} DAG bundle(s)")
 
     # Check connection associations
     if connection_count := session.scalar(
-        select(func.count(Connection.id)).where(Connection.team_id == team.id)
+        select(func.count(Connection.id)).where(Connection.team_name == team.name)
     ):
         associations.append(f"{connection_count} connection(s)")
 
     # Check variable associations
-    if variable_count := session.scalar(select(func.count(Variable.id)).where(Variable.team_id == team.id)):
+    if variable_count := session.scalar(
+        select(func.count(Variable.id)).where(Variable.team_name == team.name)
+    ):
         associations.append(f"{variable_count} variable(s)")
 
     # Check pool associations
-    if pool_count := session.scalar(select(func.count(Pool.id)).where(Pool.team_id == team.id)):
+    if pool_count := session.scalar(select(func.count(Pool.id)).where(Pool.team_name == team.name)):
         associations.append(f"{pool_count} pool(s)")
 
     # If there are associations, prevent deletion
diff --git a/airflow-core/src/airflow/migrations/versions/0094_3_1_0_remove_team_id.py b/airflow-core/src/airflow/migrations/versions/0094_3_1_0_remove_team_id.py
new file mode 100644
index 0000000000000..73964505470e0
--- /dev/null
+++ b/airflow-core/src/airflow/migrations/versions/0094_3_1_0_remove_team_id.py
@@ -0,0 +1,148 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""
+Drop ``id`` column from ``team`` table and make ``name`` the primary key.
+
+Revision ID: b12d4f98a91e
+Revises: 665854ef0536
+Create Date: 2025-12-05
+"""
+
+from __future__ import annotations
+
+import sqlalchemy as sa
+from alembic import op
+
+revision = "b12d4f98a91e"
+down_revision = "665854ef0536"
+branch_labels = None
+depends_on = None
+airflow_version = "3.1.0"
+
+
+def upgrade():
+    # Drop team id references
+    for table in ("connection", "variable", "slot_pool"):
+        with op.batch_alter_table(table) as batch_op:
+            batch_op.drop_constraint(batch_op.f(f"{table}_team_id_fkey"), type_="foreignkey")
+
+    with op.batch_alter_table("dag_bundle_team") as batch_op:
+        batch_op.drop_constraint("dag_bundle_team_team_id_fkey", type_="foreignkey")
+        batch_op.drop_index("idx_dag_bundle_team_team_id")
+
+    for table in ("connection", "variable", "slot_pool"):
+        with op.batch_alter_table(table) as batch_op:
+            batch_op.alter_column(
+                "team_id",
+                new_column_name="team_name",
+                type_=sa.String(50),
+                existing_type=sa.String(),
+                nullable=True,
+            )
+
+    with op.batch_alter_table("dag_bundle_team") as batch_op:
+        batch_op.alter_column(
+            "team_id",
+            new_column_name="team_name",
+            type_=sa.String(50),
+            nullable=False,
+        )
+
+    # Team table
+    with op.batch_alter_table("team") as batch_op:
+        batch_op.drop_constraint("team_pkey", type_="primary")
+        batch_op.drop_constraint("team_name_uq", type_="unique")
+        batch_op.drop_column("id")
+        batch_op.create_primary_key("team_pkey", ["name"])
+
+    with op.batch_alter_table("dag_bundle_team") as batch_op:
+        batch_op.create_index("idx_dag_bundle_team_team_name", ["team_name"])
+        batch_op.create_foreign_key(
+            "dag_bundle_team_team_name_fkey",
+            "team",
+            ["team_name"],
+            ["name"],
+            ondelete="CASCADE",
+        )
+
+    # Recreate foreign keys referencing team.name
+    for table in ("connection", "variable", "slot_pool"):
+        with op.batch_alter_table(table) as batch_op:
+            batch_op.create_foreign_key(
+                batch_op.f(f"{table}_team_name_fkey"),
+                "team",
+                local_cols=["team_name"],
+                remote_cols=["name"],
+                ondelete="SET NULL",
+            )
+
+
+def downgrade():
+    # Drop FKs pointing to name
+    for table in ("connection", "variable", "slot_pool"):
+        with op.batch_alter_table(table) as batch_op:
+            batch_op.drop_constraint(batch_op.f(f"{table}_team_name_fkey"), type_="foreignkey")
+
+    with op.batch_alter_table("dag_bundle_team") as batch_op:
+        batch_op.drop_constraint("dag_bundle_team_team_name_fkey", type_="foreignkey")
+        batch_op.drop_index("idx_dag_bundle_team_team_name")
+
+    # Add back team.id
+    with op.batch_alter_table("team") as batch_op:
+        batch_op.drop_constraint("team_pkey", type_="primary")
+        batch_op.add_column(sa.Column("id", sa.String(36), nullable=False))
+        batch_op.create_unique_constraint("team_name_uq", ["name"])
+        batch_op.create_primary_key("team_pkey", ["id"])
+
+    # Rename team_name → team_id
+    for table in ("connection", "variable", "slot_pool"):
+        with op.batch_alter_table(table) as batch_op:
+            batch_op.alter_column(
+                "team_name",
+                new_column_name="team_id",
+                type_=sa.String(36),
+                nullable=True,
+            )
+
+    with op.batch_alter_table("dag_bundle_team") as batch_op:
+        batch_op.alter_column(
+            "team_name",
+            new_column_name="team_id",
+            type_=sa.String(36),
+            nullable=False,
+        )
+
+    # Re-create FK on old id
+    for table in ("connection", "variable", "slot_pool"):
+        with op.batch_alter_table(table) as batch_op:
+            batch_op.create_foreign_key(
+                batch_op.f(f"{table}_team_id_fkey"),
+                "team",
+                ["team_id"],
+                ["id"],
+            )
+
+    with op.batch_alter_table("dag_bundle_team") as batch_op:
+        batch_op.create_foreign_key(
+            "dag_bundle_team_team_id_fkey",
+            "team",
+            ["team_id"],
+            ["id"],
+            ondelete="CASCADE",
+        )
diff --git a/airflow-core/src/airflow/models/connection.py b/airflow-core/src/airflow/models/connection.py
index 5c57f53922e0c..7e44c636c20de 100644
--- a/airflow-core/src/airflow/models/connection.py
+++ b/airflow-core/src/airflow/models/connection.py
@@ -29,14 +29,12 @@
 
 from sqlalchemy import Boolean, ForeignKey, Integer, String, Text, select
 from sqlalchemy.orm import Mapped, declared_attr, reconstructor, synonym
-from sqlalchemy_utils import UUIDType
 
 from airflow._shared.secrets_masker import mask_secret
 from airflow.configuration import ensure_secrets_loaded
 from airflow.exceptions import AirflowException, AirflowNotFoundException
 from airflow.models.base import ID_LEN, Base
 from airflow.models.crypto import get_fernet
-from airflow.models.team import Team
 from airflow.sdk import SecretCache
 from airflow.utils.helpers import prune_dict
 from airflow.utils.log.logging_mixin import LoggingMixin
@@ -140,7 +138,11 @@ class Connection(Base, LoggingMixin):
     port: Mapped[int | None] = mapped_column(Integer(), nullable=True)
     is_encrypted: Mapped[bool] = mapped_column(Boolean, unique=False, default=False)
     is_extra_encrypted: Mapped[bool] = mapped_column(Boolean, unique=False, default=False)
-    team_id: Mapped[str | None] = mapped_column(UUIDType(binary=False), ForeignKey("team.id"), nullable=True)
+    team_name: Mapped[str | None] = mapped_column(
+        String(50),
+        ForeignKey("team.name", ondelete="SET NULL"),
+        nullable=True,
+    )
     _extra: Mapped[str | None] = mapped_column("extra", Text(), nullable=True)
 
     def __init__(
@@ -155,7 +157,7 @@ def __init__(
         port: int | None = None,
         extra: str | dict | None = None,
         uri: str | None = None,
-        team_id: str | None = None,
+        team_name: str | None = None,
     ):
         super().__init__()
         self.description = description
@@ -190,7 +192,7 @@ def __init__(
         if self.password:
             mask_secret(self.password)
             mask_secret(quote(self.password))
-        self.team_id = team_id
+        self.team_name = team_name
 
     @staticmethod
     def _validate_extra(extra, conn_id) -> None:
@@ -605,11 +607,7 @@ def as_json(self) -> str:
     @staticmethod
     @provide_session
     def get_team_name(connection_id: str, session=NEW_SESSION) -> str | None:
-        stmt = (
-            select(Team.name)
-            .join(Connection, Team.id == Connection.team_id)
-            .where(Connection.conn_id == connection_id)
-        )
+        stmt = select(Connection.team_name).where(Connection.conn_id == connection_id)
         return session.scalar(stmt)
 
     @staticmethod
@@ -617,9 +615,5 @@ def get_team_name(connection_id: str, session=NEW_SESSION) -> str | None:
     def get_conn_id_to_team_name_mapping(
         connection_ids: list[str], session=NEW_SESSION
     ) -> dict[str, str | None]:
-        stmt = (
-            select(Connection.conn_id, Team.name)
-            .join(Team, Connection.team_id == Team.id)
-            .where(Connection.conn_id.in_(connection_ids))
-        )
+        stmt = select(Connection.conn_id, Connection.team_name).where(Connection.conn_id.in_(connection_ids))
         return {conn_id: team_name for conn_id, team_name in session.execute(stmt)}
diff --git a/airflow-core/src/airflow/models/pool.py b/airflow-core/src/airflow/models/pool.py
index b2f546a91daa9..037665f884e58 100644
--- a/airflow-core/src/airflow/models/pool.py
+++ b/airflow-core/src/airflow/models/pool.py
@@ -22,11 +22,9 @@
 
 from sqlalchemy import Boolean, ForeignKey, Integer, String, Text, func, select
 from sqlalchemy.orm import Mapped
-from sqlalchemy_utils import UUIDType
 
 from airflow.exceptions import AirflowException, PoolNotFound
 from airflow.models.base import Base
-from airflow.models.team import Team
 from airflow.ti_deps.dependencies_states import EXECUTION_STATES
 from airflow.utils.db import exists_query
 from airflow.utils.session import NEW_SESSION, provide_session
@@ -61,7 +59,9 @@ class Pool(Base):
     slots: Mapped[int] = mapped_column(Integer, default=0)
     description: Mapped[str | None] = mapped_column(Text, nullable=True)
     include_deferred: Mapped[bool] = mapped_column(Boolean, nullable=False)
-    team_id: Mapped[str | None] = mapped_column(UUIDType(binary=False), ForeignKey("team.id"), nullable=True)
+    team_name: Mapped[str | None] = mapped_column(
+        String(50), ForeignKey("team.name", ondelete="SET NULL"), nullable=True
+    )
 
     DEFAULT_POOL_NAME = "default_pool"
 
@@ -360,7 +360,7 @@ def open_slots(self, session: Session = NEW_SESSION) -> float:
     @staticmethod
     @provide_session
     def get_team_name(pool_name: str, session: Session = NEW_SESSION) -> str | None:
-        stmt = select(Team.name).join(Pool, Team.id == Pool.team_id).where(Pool.pool == pool_name)
+        stmt = select(Pool.team_name).where(Pool.pool == pool_name)
         return session.scalar(stmt)
 
     @staticmethod
@@ -368,7 +368,5 @@ def get_team_name(pool_name: str, session: Session = NEW_SESSION) -> str | None:
     def get_name_to_team_name_mapping(
         pool_names: list[str], session: Session = NEW_SESSION
     ) -> dict[str, str | None]:
-        stmt = (
-            select(Pool.pool, Team.name).join(Team, Pool.team_id == Team.id).where(Pool.pool.in_(pool_names))
-        )
+        stmt = select(Pool.pool, Pool.team_name).where(Pool.pool.in_(pool_names))
         return {pool: team_name for pool, team_name in session.execute(stmt)}
diff --git a/airflow-core/src/airflow/models/team.py b/airflow-core/src/airflow/models/team.py
index 551b426abcace..8a65ee5948147 100644
--- a/airflow-core/src/airflow/models/team.py
+++ b/airflow-core/src/airflow/models/team.py
@@ -19,10 +19,8 @@
 
 from typing import TYPE_CHECKING
 
-import uuid6
 from sqlalchemy import Column, ForeignKey, Index, String, Table, select
 from sqlalchemy.orm import Mapped, relationship
-from sqlalchemy_utils import UUIDType
 
 from airflow.models.base import Base, StringID
 from airflow.utils.session import NEW_SESSION, provide_session
@@ -40,9 +38,9 @@
         ForeignKey("dag_bundle.name", ondelete="CASCADE"),
         primary_key=True,
     ),
-    Column("team_id", UUIDType(binary=False), ForeignKey("team.id", ondelete="CASCADE"), primary_key=True),
+    Column("team_name", String(50), ForeignKey("team.name", ondelete="CASCADE"), primary_key=True),
     Index("idx_dag_bundle_team_dag_bundle_name", "dag_bundle_name", unique=True),
-    Index("idx_dag_bundle_team_team_id", "team_id"),
+    Index("idx_dag_bundle_team_team_name", "team_name"),
 )
 
 
@@ -55,33 +53,17 @@ class Team(Base):
 
     __tablename__ = "team"
 
-    id: Mapped[str] = mapped_column(UUIDType(binary=False), primary_key=True, default=uuid6.uuid7)
-    name: Mapped[str] = mapped_column(String(50), unique=True, nullable=False)
+    name: Mapped[str] = mapped_column(String(50), primary_key=True)
     dag_bundles = relationship(
         "DagBundleModel", secondary=dag_bundle_team_association_table, back_populates="teams"
     )
 
     def __repr__(self):
-        return f"Team(id={self.id},name={self.name})"
+        return f"Team(name={self.name})"
 
     @classmethod
     @provide_session
-    def get_all_teams_id_to_name_mapping(cls, session: Session = NEW_SESSION) -> dict[str, str]:
-        """
-        Return a mapping of all team IDs to team names from the database.
-
-        This method provides a reusable way to get team information that can be used
-        across the codebase for validation and lookups.
-
-        :param session: Database session
-        :return: Dictionary mapping team UUIDs to team names
-        """
-        stmt = select(cls.id, cls.name)
-        teams = session.execute(stmt).all()
-        return {str(team_id): team_name for team_id, team_name in teams}
-
-    @classmethod
-    def get_all_team_names(cls) -> set[str]:
+    def get_all_team_names(cls, session: Session = NEW_SESSION) -> set[str]:
         """
         Return a set of all team names from the database.
 
@@ -90,5 +72,4 @@ def get_all_team_names(cls) -> set[str]:
 
         :return: Set of all team names
         """
-        team_mapping = cls.get_all_teams_id_to_name_mapping()
-        return set(team_mapping.values())
+        return set(session.scalars(select(Team.name)).all())
diff --git a/airflow-core/src/airflow/models/variable.py b/airflow-core/src/airflow/models/variable.py
index 87d1445a06597..a6e0ea5cf494a 100644
--- a/airflow-core/src/airflow/models/variable.py
+++ b/airflow-core/src/airflow/models/variable.py
@@ -27,13 +27,11 @@
 from sqlalchemy import Boolean, ForeignKey, Integer, String, Text, delete, select
 from sqlalchemy.dialects.mysql import MEDIUMTEXT
 from sqlalchemy.orm import Mapped, declared_attr, reconstructor, synonym
-from sqlalchemy_utils import UUIDType
 
 from airflow._shared.secrets_masker import mask_secret
 from airflow.configuration import conf, ensure_secrets_loaded
 from airflow.models.base import ID_LEN, Base
 from airflow.models.crypto import get_fernet
-from airflow.models.team import Team
 from airflow.sdk import SecretCache
 from airflow.secrets.metastore import MetastoreBackend
 from airflow.utils.log.logging_mixin import LoggingMixin
@@ -60,14 +58,18 @@ class Variable(Base, LoggingMixin):
     _val: Mapped[str] = mapped_column("val", Text().with_variant(MEDIUMTEXT, "mysql"))
     description: Mapped[str | None] = mapped_column(Text, nullable=True)
     is_encrypted: Mapped[bool] = mapped_column(Boolean, unique=False, default=False)
-    team_id: Mapped[str | None] = mapped_column(UUIDType(binary=False), ForeignKey("team.id"), nullable=True)
+    team_name: Mapped[str | None] = mapped_column(
+        String(50),
+        ForeignKey("team.name", ondelete="SET NULL"),
+        nullable=True,
+    )
 
-    def __init__(self, key=None, val=None, description=None, team_id=None):
+    def __init__(self, key=None, val=None, description=None, team_name=None):
         super().__init__()
         self.key = key
         self.val = val
         self.description = description
-        self.team_id = team_id
+        self.team_name = team_name
 
     @reconstructor
     def on_db_load(self):
@@ -185,7 +187,7 @@ def set(
         value: Any,
         description: str | None = None,
         serialize_json: bool = False,
-        team_id: str | None = None,
+        team_name: str | None = None,
         session: Session | None = None,
     ) -> None:
         """
@@ -197,7 +199,7 @@ def set(
         :param value: Value to set for the Variable
         :param description: Description of the Variable
         :param serialize_json: Serialize the value to a JSON string
-        :param team_id: ID of the team associated to the variable (if any)
+        :param team_name: Team name associated to the variable (if any)
         :param session: optional session, use if provided or create a new one
         """
         # TODO: This is not the best way of having compat, but it's "better than erroring" for now. This still
@@ -223,7 +225,7 @@ def set(
             )
             return
 
-        if team_id and not conf.getboolean("core", "multi_team"):
+        if team_name and not conf.getboolean("core", "multi_team"):
             raise ValueError(
                 "Multi-team mode is not configured in the Airflow environment. To assign a team to a variable, multi-mode must be enabled."
             )
@@ -242,7 +244,7 @@ def set(
             ctx = create_session()
 
         with ctx as session:
-            new_variable = Variable(key=key, val=stored_value, description=description, team_id=team_id)
+            new_variable = Variable(key=key, val=stored_value, description=description, team_name=team_name)
 
             val = new_variable._val
             is_encrypted = new_variable.is_encrypted
@@ -259,7 +261,7 @@ def set(
                     val=val,
                     description=description,
                     is_encrypted=is_encrypted,
-                    team_id=team_id,
+                    team_name=team_name,
                 )
                 stmt = pg_stmt.on_conflict_do_update(
                     index_elements=["key"],
@@ -267,7 +269,7 @@ def set(
                         val=val,
                         description=description,
                         is_encrypted=is_encrypted,
-                        team_id=team_id,
+                        team_name=team_name,
                     ),
                 )
             elif dialect_name == "mysql":
@@ -278,13 +280,13 @@ def set(
                     val=val,
                     description=description,
                     is_encrypted=is_encrypted,
-                    team_id=team_id,
+                    team_name=team_name,
                 )
                 stmt = mysql_stmt.on_duplicate_key_update(
                     val=val,
                     description=description,
                     is_encrypted=is_encrypted,
-                    team_id=team_id,
+                    team_name=team_name,
                 )
             else:
                 from sqlalchemy.dialects.sqlite import insert as sqlite_insert
@@ -294,7 +296,7 @@ def set(
                     val=val,
                     description=description,
                     is_encrypted=is_encrypted,
-                    team_id=team_id,
+                    team_name=team_name,
                 )
                 stmt = sqlite_stmt.on_conflict_do_update(
                     index_elements=["key"],
@@ -302,7 +304,7 @@ def set(
                         val=val,
                         description=description,
                         is_encrypted=is_encrypted,
-                        team_id=team_id,
+                        team_name=team_name,
                     ),
                 )
 
@@ -490,17 +492,11 @@ def get_variable_from_secrets(key: str) -> str | None:
     @staticmethod
     @provide_session
     def get_team_name(variable_key: str, session=NEW_SESSION) -> str | None:
-        stmt = (
-            select(Team.name).join(Variable, Team.id == Variable.team_id).where(Variable.key == variable_key)
-        )
+        stmt = select(Variable.team_name).where(Variable.key == variable_key)
         return session.scalar(stmt)
 
     @staticmethod
     @provide_session
     def get_key_to_team_name_mapping(variable_keys: list[str], session=NEW_SESSION) -> dict[str, str | None]:
-        stmt = (
-            select(Variable.key, Team.name)
-            .join(Team, Variable.team_id == Team.id)
-            .where(Variable.key.in_(variable_keys))
-        )
+        stmt = select(Variable.key, Variable.team_name).where(Variable.key.in_(variable_keys))
         return {key: team_name for key, team_name in session.execute(stmt)}
diff --git a/airflow-core/src/airflow/ui/openapi-gen/queries/ensureQueryData.ts b/airflow-core/src/airflow/ui/openapi-gen/queries/ensureQueryData.ts
index 6ff5dc02fb5f7..fb3c855f1d5e5 100644
--- a/airflow-core/src/airflow/ui/openapi-gen/queries/ensureQueryData.ts
+++ b/airflow-core/src/airflow/ui/openapi-gen/queries/ensureQueryData.ts
@@ -1637,7 +1637,7 @@ export const ensureUseCalendarServiceGetCalendarData = (queryClient: QueryClient
 * @param data The data for the request.
 * @param data.limit
 * @param data.offset
-* @param data.orderBy Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `id`
+* @param data.orderBy Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `name`
 * @returns TeamCollectionResponse Successful Response
 * @throws ApiError
 */
diff --git a/airflow-core/src/airflow/ui/openapi-gen/queries/prefetch.ts b/airflow-core/src/airflow/ui/openapi-gen/queries/prefetch.ts
index b8eaa08e038f1..39452099cae66 100644
--- a/airflow-core/src/airflow/ui/openapi-gen/queries/prefetch.ts
+++ b/airflow-core/src/airflow/ui/openapi-gen/queries/prefetch.ts
@@ -1637,7 +1637,7 @@ export const prefetchUseCalendarServiceGetCalendar = (queryClient: QueryClient,
 * @param data The data for the request.
 * @param data.limit
 * @param data.offset
-* @param data.orderBy Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `id`
+* @param data.orderBy Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `name`
 * @returns TeamCollectionResponse Successful Response
 * @throws ApiError
 */
diff --git a/airflow-core/src/airflow/ui/openapi-gen/queries/queries.ts b/airflow-core/src/airflow/ui/openapi-gen/queries/queries.ts
index 57cb60e73325b..2c290c1daf6db 100644
--- a/airflow-core/src/airflow/ui/openapi-gen/queries/queries.ts
+++ b/airflow-core/src/airflow/ui/openapi-gen/queries/queries.ts
@@ -1637,7 +1637,7 @@ export const useCalendarServiceGetCalendar = <TData = Common.CalendarServiceGetC
 * @param data The data for the request.
 * @param data.limit
 * @param data.offset
-* @param data.orderBy Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `id`
+* @param data.orderBy Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `name`
 * @returns TeamCollectionResponse Successful Response
 * @throws ApiError
 */
diff --git a/airflow-core/src/airflow/ui/openapi-gen/queries/suspense.ts b/airflow-core/src/airflow/ui/openapi-gen/queries/suspense.ts
index 47cd4bc8289ad..4dcb5ddfb25d8 100644
--- a/airflow-core/src/airflow/ui/openapi-gen/queries/suspense.ts
+++ b/airflow-core/src/airflow/ui/openapi-gen/queries/suspense.ts
@@ -1637,7 +1637,7 @@ export const useCalendarServiceGetCalendarSuspense = <TData = Common.CalendarSer
 * @param data The data for the request.
 * @param data.limit
 * @param data.offset
-* @param data.orderBy Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `id`
+* @param data.orderBy Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `name`
 * @returns TeamCollectionResponse Successful Response
 * @throws ApiError
 */
diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts b/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts
index 87b621b316212..f5c194142c187 100644
--- a/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts
+++ b/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts
@@ -6560,17 +6560,17 @@ export const $VariableBody = {
             ],
             title: 'Description'
         },
-        team_id: {
+        team_name: {
             anyOf: [
                 {
                     type: 'string',
-                    format: 'uuid'
+                    maxLength: 50
                 },
                 {
                     type: 'null'
                 }
             ],
-            title: 'Team Id'
+            title: 'Team Name'
         }
     },
     additionalProperties: false,
@@ -6625,21 +6625,20 @@ export const $VariableResponse = {
             type: 'boolean',
             title: 'Is Encrypted'
         },
-        team_id: {
+        team_name: {
             anyOf: [
                 {
-                    type: 'string',
-                    format: 'uuid'
+                    type: 'string'
                 },
                 {
                     type: 'null'
                 }
             ],
-            title: 'Team Id'
+            title: 'Team Name'
         }
     },
     type: 'object',
-    required: ['key', 'value', 'description', 'is_encrypted', 'team_id'],
+    required: ['key', 'value', 'description', 'is_encrypted', 'team_name'],
     title: 'VariableResponse',
     description: 'Variable serializer for responses.'
 } as const;
@@ -8222,18 +8221,13 @@ export const $TeamCollectionResponse = {
 
 export const $TeamResponse = {
     properties: {
-        id: {
-            type: 'string',
-            format: 'uuid',
-            title: 'Id'
-        },
         name: {
             type: 'string',
             title: 'Name'
         }
     },
     type: 'object',
-    required: ['id', 'name'],
+    required: ['name'],
     title: 'TeamResponse',
     description: 'Base serializer for Team.'
 } as const;
diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts b/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts
index f01a1f9be696b..0d3210084ab34 100644
--- a/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts
+++ b/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts
@@ -4046,7 +4046,7 @@ export class TeamsService {
      * @param data The data for the request.
      * @param data.limit
      * @param data.offset
-     * @param data.orderBy Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `id`
+     * @param data.orderBy Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `name`
      * @returns TeamCollectionResponse Successful Response
      * @throws ApiError
      */
diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts b/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts
index b65cd4d2d4503..eb0d872cefb3e 100644
--- a/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts
+++ b/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts
@@ -1594,7 +1594,7 @@ export type VariableBody = {
     key: string;
     value: JsonValue;
     description?: string | null;
-    team_id?: string | null;
+    team_name?: string | null;
 };
 
 /**
@@ -1613,7 +1613,7 @@ export type VariableResponse = {
     value: string;
     description: string | null;
     is_encrypted: boolean;
-    team_id: string | null;
+    team_name: string | null;
 };
 
 /**
@@ -2048,7 +2048,6 @@ export type TeamCollectionResponse = {
  * Base serializer for Team.
  */
 export type TeamResponse = {
-    id: string;
     name: string;
 };
 
@@ -3436,7 +3435,7 @@ export type ListTeamsData = {
     limit?: number;
     offset?: number;
     /**
-     * Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `id`
+     * Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `name`
      */
     orderBy?: Array<(string)>;
 };
diff --git a/airflow-core/src/airflow/utils/db.py b/airflow-core/src/airflow/utils/db.py
index 231a74966c868..b776333d10d1c 100644
--- a/airflow-core/src/airflow/utils/db.py
+++ b/airflow-core/src/airflow/utils/db.py
@@ -110,7 +110,7 @@ class MappedClassProtocol(Protocol):
     "2.10.3": "5f2621c13b39",
     "3.0.0": "29ce7909c52b",
     "3.0.3": "fe199e1abd77",
-    "3.1.0": "cc92b33c6709",
+    "3.1.0": "b12d4f98a91e",
     "3.2.0": "665854ef0536",
 }
 
diff --git a/airflow-core/tests/unit/api_fastapi/auth/managers/test_base_auth_manager.py b/airflow-core/tests/unit/api_fastapi/auth/managers/test_base_auth_manager.py
index 33149655375dd..cfaaeb3c3c364 100644
--- a/airflow-core/tests/unit/api_fastapi/auth/managers/test_base_auth_manager.py
+++ b/airflow-core/tests/unit/api_fastapi/auth/managers/test_base_auth_manager.py
@@ -454,13 +454,13 @@ def side_effect_func(
             # No access to any team
             (
                 {},
-                [("1", "team1"), ("2", "team2")],
+                ["team1", "team2"],
                 set(),
             ),
             # Access to specific teams
             (
                 {"team1": True},
-                [("1", "team1"), ("2", "team2")],
+                ["team1", "team2"],
                 {"team1"},
             ),
         ],
@@ -479,7 +479,7 @@ def side_effect_func(
         auth_manager.is_authorized_team = MagicMock(side_effect=side_effect_func)
         user = Mock()
         session = Mock()
-        session.execute.return_value.all.return_value = rows
+        session.scalars.return_value.all.return_value = rows
         result = auth_manager.get_authorized_teams(user=user, session=session)
         assert result == expected
 
diff --git a/airflow-core/tests/unit/api_fastapi/common/test_exceptions.py b/airflow-core/tests/unit/api_fastapi/common/test_exceptions.py
index 9d06ad325cf5a..f77b741bcaa66 100644
--- a/airflow-core/tests/unit/api_fastapi/common/test_exceptions.py
+++ b/airflow-core/tests/unit/api_fastapi/common/test_exceptions.py
@@ -133,7 +133,7 @@ def teardown_method(self) -> None:
                         status_code=status.HTTP_409_CONFLICT,
                         detail={
                             "reason": "Unique constraint violation",
-                            "statement": "INSERT INTO slot_pool (pool, slots, description, include_deferred, team_id) VALUES (?, ?, ?, ?, ?)",
+                            "statement": "INSERT INTO slot_pool (pool, slots, description, include_deferred, team_name) VALUES (?, ?, ?, ?, ?)",
                             "orig_error": "UNIQUE constraint failed: slot_pool.pool",
                             "message": MESSAGE,
                         },
@@ -142,7 +142,7 @@ def teardown_method(self) -> None:
                         status_code=status.HTTP_409_CONFLICT,
                         detail={
                             "reason": "Unique constraint violation",
-                            "statement": "INSERT INTO slot_pool (pool, slots, description, include_deferred, team_id) VALUES (%s, %s, %s, %s, %s)",
+                            "statement": "INSERT INTO slot_pool (pool, slots, description, include_deferred, team_name) VALUES (%s, %s, %s, %s, %s)",
                             "orig_error": "(1062, \"Duplicate entry 'test_pool' for key 'slot_pool.slot_pool_pool_uq'\")",
                             "message": MESSAGE,
                         },
@@ -151,7 +151,7 @@ def teardown_method(self) -> None:
                         status_code=status.HTTP_409_CONFLICT,
                         detail={
                             "reason": "Unique constraint violation",
-                            "statement": f"INSERT INTO slot_pool (pool, slots, description, include_deferred, team_id) VALUES (%(pool)s, %(slots)s, %(description)s, %(include_deferred)s, %(team_id)s{uuid_suffix}) RETURNING slot_pool.id",
+                            "statement": f"INSERT INTO slot_pool (pool, slots, description, include_deferred, team_name) VALUES (%(pool)s, %(slots)s, %(description)s, %(include_deferred)s, %(team_name)s{uuid_suffix}) RETURNING slot_pool.id",
                             "orig_error": 'duplicate key value violates unique constraint "slot_pool_pool_uq"\nDETAIL:  Key (pool)=(test_pool) already exists.\n',
                             "message": MESSAGE,
                         },
@@ -162,7 +162,7 @@ def teardown_method(self) -> None:
                         status_code=status.HTTP_409_CONFLICT,
                         detail={
                             "reason": "Unique constraint violation",
-                            "statement": 'INSERT INTO variable ("key", val, description, is_encrypted, team_id) VALUES (?, ?, ?, ?, ?)',
+                            "statement": 'INSERT INTO variable ("key", val, description, is_encrypted, team_name) VALUES (?, ?, ?, ?, ?)',
                             "orig_error": "UNIQUE constraint failed: variable.key",
                             "message": MESSAGE,
                         },
@@ -171,7 +171,7 @@ def teardown_method(self) -> None:
                         status_code=status.HTTP_409_CONFLICT,
                         detail={
                             "reason": "Unique constraint violation",
-                            "statement": "INSERT INTO variable (`key`, val, description, is_encrypted, team_id) VALUES (%s, %s, %s, %s, %s)",
+                            "statement": "INSERT INTO variable (`key`, val, description, is_encrypted, team_name) VALUES (%s, %s, %s, %s, %s)",
                             "orig_error": "(1062, \"Duplicate entry 'test_key' for key 'variable.variable_key_uq'\")",
                             "message": MESSAGE,
                         },
@@ -180,7 +180,7 @@ def teardown_method(self) -> None:
                         status_code=status.HTTP_409_CONFLICT,
                         detail={
                             "reason": "Unique constraint violation",
-                            "statement": f"INSERT INTO variable (key, val, description, is_encrypted, team_id) VALUES (%(key)s, %(val)s, %(description)s, %(is_encrypted)s, %(team_id)s{uuid_suffix}) RETURNING variable.id",
+                            "statement": f"INSERT INTO variable (key, val, description, is_encrypted, team_name) VALUES (%(key)s, %(val)s, %(description)s, %(is_encrypted)s, %(team_name)s{uuid_suffix}) RETURNING variable.id",
                             "orig_error": 'duplicate key value violates unique constraint "variable_key_uq"\nDETAIL:  Key (key)=(test_key) already exists.\n',
                             "message": MESSAGE,
                         },
diff --git a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_variables.py b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_variables.py
index b235db785b39d..a12a05b45b94a 100644
--- a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_variables.py
+++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_variables.py
@@ -92,7 +92,7 @@ def _create_variables(session) -> None:
         key=TEST_VARIABLE_KEY4,
         value=TEST_VARIABLE_VALUE4,
         description=TEST_VARIABLE_DESCRIPTION4,
-        team_id=team.id,
+        team_name=team.name,
         session=session,
     )
 
@@ -110,11 +110,6 @@ def _create_team(session) -> None:
     session.commit()
 
 
-@pytest.fixture(scope="session")
-def team_id(session):
-    return str(session.query(Team.id).filter_by(name="test").one()[0])
-
-
 class TestVariableEndpoint:
     @pytest.fixture(autouse=True)
     def setup(self):
@@ -172,7 +167,7 @@ class TestGetVariable(TestVariableEndpoint):
                     "value": TEST_VARIABLE_VALUE,
                     "description": TEST_VARIABLE_DESCRIPTION,
                     "is_encrypted": True,
-                    "team_id": None,
+                    "team_name": None,
                 },
             ),
             (
@@ -182,7 +177,7 @@ class TestGetVariable(TestVariableEndpoint):
                     "value": "***",
                     "description": TEST_VARIABLE_DESCRIPTION2,
                     "is_encrypted": True,
-                    "team_id": None,
+                    "team_name": None,
                 },
             ),
             (
@@ -192,7 +187,7 @@ class TestGetVariable(TestVariableEndpoint):
                     "value": '{"password": "***"}',
                     "description": TEST_VARIABLE_DESCRIPTION3,
                     "is_encrypted": True,
-                    "team_id": None,
+                    "team_name": None,
                 },
             ),
             (
@@ -202,7 +197,7 @@ class TestGetVariable(TestVariableEndpoint):
                     "value": TEST_VARIABLE_VALUE4,
                     "description": TEST_VARIABLE_DESCRIPTION4,
                     "is_encrypted": True,
-                    "team_id": ANY,
+                    "team_name": ANY,
                 },
             ),
             (
@@ -212,7 +207,7 @@ class TestGetVariable(TestVariableEndpoint):
                     "value": TEST_VARIABLE_SEARCH_VALUE,
                     "description": TEST_VARIABLE_SEARCH_DESCRIPTION,
                     "is_encrypted": True,
-                    "team_id": None,
+                    "team_name": None,
                 },
             ),
         ],
@@ -370,7 +365,7 @@ class TestPatchVariable(TestVariableEndpoint):
                     "value": "The new value",
                     "description": "The new description",
                     "is_encrypted": True,
-                    "team_id": None,
+                    "team_name": None,
                 },
             ),
             (
@@ -379,7 +374,7 @@ class TestPatchVariable(TestVariableEndpoint):
                     "key": TEST_VARIABLE_KEY,
                     "value": "The new value",
                     "description": "The new description",
-                    "team_id": None,
+                    "team_name": None,
                 },
                 {"update_mask": ["value"]},
                 {
@@ -387,7 +382,7 @@ class TestPatchVariable(TestVariableEndpoint):
                     "value": "The new value",
                     "description": TEST_VARIABLE_DESCRIPTION,
                     "is_encrypted": True,
-                    "team_id": None,
+                    "team_name": None,
                 },
             ),
             (
@@ -403,7 +398,7 @@ class TestPatchVariable(TestVariableEndpoint):
                     "value": "The new value",
                     "description": TEST_VARIABLE_DESCRIPTION4,
                     "is_encrypted": True,
-                    "team_id": ANY,
+                    "team_name": ANY,
                 },
             ),
             (
@@ -419,7 +414,7 @@ class TestPatchVariable(TestVariableEndpoint):
                     "value": "***",
                     "description": TEST_VARIABLE_DESCRIPTION2,
                     "is_encrypted": True,
-                    "team_id": None,
+                    "team_name": None,
                 },
             ),
             (
@@ -435,7 +430,7 @@ class TestPatchVariable(TestVariableEndpoint):
                     "value": '{"password": "***"}',
                     "description": "new description",
                     "is_encrypted": True,
-                    "team_id": None,
+                    "team_name": None,
                 },
             ),
         ],
@@ -453,7 +448,7 @@ def test_patch_with_team_should_respond_200(self, test_client, session, testing_
             "key": TEST_VARIABLE_KEY,
             "value": "The new value",
             "description": "The new description",
-            "team_id": str(testing_team.id),
+            "team_name": str(testing_team.name),
         }
         response = test_client.patch(f"/variables/{TEST_VARIABLE_KEY}", json=body)
         assert response.status_code == 200
@@ -462,7 +457,7 @@ def test_patch_with_team_should_respond_200(self, test_client, session, testing_
             "value": "The new value",
             "description": "The new description",
             "is_encrypted": True,
-            "team_id": str(testing_team.id),
+            "team_name": testing_team.name,
         }
         check_last_log(session, dag_id=None, event="patch_variable", logical_date=None)
 
@@ -515,7 +510,7 @@ class TestPostVariable(TestVariableEndpoint):
                     "value": "new variable value",
                     "description": "new variable description",
                     "is_encrypted": True,
-                    "team_id": None,
+                    "team_name": None,
                 },
             ),
             (
@@ -529,7 +524,7 @@ class TestPostVariable(TestVariableEndpoint):
                     "value": "***",
                     "description": "another password",
                     "is_encrypted": True,
-                    "team_id": None,
+                    "team_name": None,
                 },
             ),
             (
@@ -543,7 +538,7 @@ class TestPostVariable(TestVariableEndpoint):
                     "value": '{"password": "***"}',
                     "description": "some description",
                     "is_encrypted": True,
-                    "team_id": None,
+                    "team_name": None,
                 },
             ),
             (
@@ -557,7 +552,7 @@ class TestPostVariable(TestVariableEndpoint):
                     "value": "",
                     "description": "some description",
                     "is_encrypted": True,
-                    "team_id": None,
+                    "team_name": None,
                 },
             ),
         ],
@@ -575,7 +570,7 @@ def test_post_with_team_should_respond_201(self, test_client, testing_team, sess
             "key": "new variable key",
             "value": "new variable value",
             "description": "new variable description",
-            "team_id": str(testing_team.id),
+            "team_name": str(testing_team.name),
         }
         response = test_client.post("/variables", json=body)
         assert response.status_code == 201
@@ -584,7 +579,7 @@ def test_post_with_team_should_respond_201(self, test_client, testing_team, sess
             "value": "new variable value",
             "description": "new variable description",
             "is_encrypted": True,
-            "team_id": str(testing_team.id),
+            "team_name": str(testing_team.name),
         }
         check_last_log(session, dag_id=None, event="post_variable", logical_date=None)
 
diff --git a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_teams.py b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_teams.py
index e17e9ba595d8d..5874b9845bd65 100644
--- a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_teams.py
+++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_teams.py
@@ -16,8 +16,6 @@
 # under the License.
 from __future__ import annotations
 
-from unittest.mock import ANY
-
 import pytest
 
 from airflow.models.team import Team
@@ -55,15 +53,12 @@ def test_should_response_200(self, test_client, session):
         assert response.json() == {
             "teams": [
                 {
-                    "id": ANY,
                     "name": "team1",
                 },
                 {
-                    "id": ANY,
                     "name": "team2",
                 },
                 {
-                    "id": ANY,
                     "name": "team3",
                 },
             ],
diff --git a/airflow-core/tests/unit/cli/commands/test_team_command.py b/airflow-core/tests/unit/cli/commands/test_team_command.py
index a06a974136a82..c9fe75be02d58 100644
--- a/airflow-core/tests/unit/cli/commands/test_team_command.py
+++ b/airflow-core/tests/unit/cli/commands/test_team_command.py
@@ -17,7 +17,6 @@
 # under the License.
 from __future__ import annotations
 
-import uuid
 from unittest.mock import patch
 
 import pytest
@@ -71,12 +70,11 @@ def test_team_create_success(self, stdout_capture):
         team = self.session.query(Team).filter(Team.name == "test-team").first()
         assert team is not None
         assert team.name == "test-team"
-        assert isinstance(team.id, uuid.UUID)
 
         # Verify output message
         output = stdout.getvalue()
         assert "Team 'test-team' created successfully" in output
-        assert str(team.id) in output
+        assert str(team.name) in output
 
     def test_team_create_empty_name(self):
         """Test team creation with empty name."""
@@ -175,7 +173,9 @@ def test_team_delete_with_dag_bundle_association(self):
 
         # Create a DAG bundle association
         self.session.execute(
-            dag_bundle_team_association_table.insert().values(dag_bundle_name="test-bundle", team_id=team.id)
+            dag_bundle_team_association_table.insert().values(
+                dag_bundle_name="test-bundle", team_name=team.name
+            )
         )
         self.session.commit()
 
@@ -193,7 +193,7 @@ def test_team_delete_with_connection_association(self):
         team = self.session.query(Team).filter(Team.name == "conn-team").first()
 
         # Create connection associated with team
-        conn = Connection(conn_id="test-conn", conn_type="http", team_id=team.id)
+        conn = Connection(conn_id="test-conn", conn_type="http", team_name=team.name)
         self.session.add(conn)
         self.session.commit()
 
@@ -211,7 +211,7 @@ def test_team_delete_with_variable_association(self):
         team = self.session.query(Team).filter(Team.name == "var-team").first()
 
         # Create variable associated with team
-        var = Variable(key="test-var", val="test-value", team_id=team.id)
+        var = Variable(key="test-var", val="test-value", team_name=team.name)
         self.session.add(var)
         self.session.commit()
 
@@ -229,7 +229,7 @@ def test_team_delete_with_pool_association(self):
 
         # Create pool associated with team
         pool = Pool(
-            pool="test-pool", slots=5, description="Test pool", include_deferred=False, team_id=team.id
+            pool="test-pool", slots=5, description="Test pool", include_deferred=False, team_name=team.name
         )
         self.session.add(pool)
         self.session.commit()
@@ -252,15 +252,17 @@ def test_team_delete_with_multiple_associations(self):
         self.session.commit()
 
         # Create multiple associations
-        conn = Connection(conn_id="multi-conn", conn_type="http", team_id=team.id)
-        var = Variable(key="multi-var", val="value", team_id=team.id)
+        conn = Connection(conn_id="multi-conn", conn_type="http", team_name=team.name)
+        var = Variable(key="multi-var", val="value", team_name=team.name)
         pool = Pool(
-            pool="multi-pool", slots=3, description="Multi pool", include_deferred=False, team_id=team.id
+            pool="multi-pool", slots=3, description="Multi pool", include_deferred=False, team_name=team.name
         )
 
         self.session.add_all([conn, var, pool])
         self.session.execute(
-            dag_bundle_team_association_table.insert().values(dag_bundle_name="multi-bundle", team_id=team.id)
+            dag_bundle_team_association_table.insert().values(
+                dag_bundle_name="multi-bundle", team_name=team.name
+            )
         )
         self.session.commit()
 
diff --git a/airflow-core/tests/unit/models/test_connection.py b/airflow-core/tests/unit/models/test_connection.py
index 947c5469e37bc..fdcce230da0d8 100644
--- a/airflow-core/tests/unit/models/test_connection.py
+++ b/airflow-core/tests/unit/models/test_connection.py
@@ -386,7 +386,7 @@ def test_get_connection_from_secrets_metastore_backend(
     def test_get_team_name(self, testing_team: Team, session: Session):
         clear_db_connections()
 
-        connection = Connection(conn_id="test_conn", conn_type="test_type", team_id=testing_team.id)
+        connection = Connection(conn_id="test_conn", conn_type="test_type", team_name=testing_team.name)
         session.add(connection)
         session.flush()
 
@@ -397,13 +397,14 @@ def test_get_team_name(self, testing_team: Team, session: Session):
     def test_get_conn_id_to_team_name_mapping(self, testing_team: Team, session: Session):
         clear_db_connections()
 
-        connection1 = Connection(conn_id="test_conn1", conn_type="test_type", team_id=testing_team.id)
+        connection1 = Connection(conn_id="test_conn1", conn_type="test_type", team_name=testing_team.name)
         connection2 = Connection(conn_id="test_conn2", conn_type="test_type")
         session.add(connection1)
         session.add(connection2)
         session.flush()
 
         assert Connection.get_conn_id_to_team_name_mapping(["test_conn1", "test_conn2"], session=session) == {
-            "test_conn1": "testing"
+            "test_conn1": "testing",
+            "test_conn2": None,
         }
         clear_db_connections()
diff --git a/airflow-core/tests/unit/models/test_pool.py b/airflow-core/tests/unit/models/test_pool.py
index 469e8e0fabad0..fa59d85ffe82d 100644
--- a/airflow-core/tests/unit/models/test_pool.py
+++ b/airflow-core/tests/unit/models/test_pool.py
@@ -328,17 +328,20 @@ def test_is_default_pool(self):
         assert Pool.is_default_pool(str(default_pool.id))
 
     def test_get_team_name(self, testing_team: Team, session: Session):
-        pool = Pool(pool="test", include_deferred=False, team_id=testing_team.id)
+        pool = Pool(pool="test", include_deferred=False, team_name=testing_team.name)
         session.add(pool)
         session.flush()
 
         assert Pool.get_team_name("test", session=session) == "testing"
 
     def test_get_name_to_team_name_mapping(self, testing_team: Team, session: Session):
-        pool1 = Pool(pool="pool1", include_deferred=False, team_id=testing_team.id)
+        pool1 = Pool(pool="pool1", include_deferred=False, team_name=testing_team.name)
         pool2 = Pool(pool="pool2", include_deferred=False)
         session.add(pool1)
         session.add(pool2)
         session.flush()
 
-        assert Pool.get_name_to_team_name_mapping(["pool1", "pool2"], session=session) == {"pool1": "testing"}
+        assert Pool.get_name_to_team_name_mapping(["pool1", "pool2"], session=session) == {
+            "pool1": "testing",
+            "pool2": None,
+        }
diff --git a/airflow-core/tests/unit/models/test_team.py b/airflow-core/tests/unit/models/test_team.py
index 9c76e75228637..4ac828fce26ca 100644
--- a/airflow-core/tests/unit/models/test_team.py
+++ b/airflow-core/tests/unit/models/test_team.py
@@ -16,8 +16,7 @@
 # under the License.
 from __future__ import annotations
 
-import uuid
-from unittest.mock import MagicMock, patch
+import pytest
 
 from airflow.models.team import Team
 
@@ -25,46 +24,9 @@
 class TestTeam:
     """Unit tests for Team model class methods."""
 
-    def test_get_all_teams_id_to_name_mapping_with_teams(self):
-        """Test get_all_teams_id_to_name_mapping returns correct mapping when teams exist."""
-        team1_id = str(uuid.uuid4())
-        team2_id = str(uuid.uuid4())
-        team3_id = str(uuid.uuid4())
+    @pytest.mark.db_test
+    def test_get_all_team_names_with_teams(self, testing_team):
+        result = Team.get_all_team_names()
 
-        mock_query_result = [
-            (team1_id, "team_alpha"),
-            (team2_id, "team_beta"),
-            (team3_id, "team_gamma"),
-        ]
-
-        # Create a mock session
-        mock_session = MagicMock()
-        mock_session.execute.return_value.all.return_value = mock_query_result
-
-        # Call the method directly with our mock session
-        result = Team.get_all_teams_id_to_name_mapping(session=mock_session)
-
-        expected = {
-            team1_id: "team_alpha",
-            team2_id: "team_beta",
-            team3_id: "team_gamma",
-        }
-        assert result == expected
-
-        # Verify the execute method was called correctly
-        mock_session.execute.assert_called_once()
-        mock_session.execute.return_value.all.assert_called_once()
-
-    def test_get_all_team_names_with_teams(self):
-        """Test get_all_team_names returns correct set of names when teams exist."""
-        mock_mapping = {
-            "uuid-1": "team_alpha",
-            "uuid-2": "team_beta",
-            "uuid-3": "team_gamma",
-        }
-
-        with patch.object(Team, "get_all_teams_id_to_name_mapping", return_value=mock_mapping):
-            result = Team.get_all_team_names()
-
-            assert result == {"team_alpha", "team_beta", "team_gamma"}
-            assert isinstance(result, set)
+        assert result == {"testing"}
+        assert isinstance(result, set)
diff --git a/airflow-core/tests/unit/models/test_variable.py b/airflow-core/tests/unit/models/test_variable.py
index 722b6a155a346..12d63c1ab77cd 100644
--- a/airflow-core/tests/unit/models/test_variable.py
+++ b/airflow-core/tests/unit/models/test_variable.py
@@ -200,14 +200,14 @@ def test_set_variable_sets_description(self, session):
 
     @conf_vars({("core", "multi_team"): "True"})
     def test_set_variable_sets_team(self, testing_team, session):
-        Variable.set(key="key", value="value", team_id=testing_team.id, session=session)
+        Variable.set(key="key", value="value", team_name=testing_team.name, session=session)
         test_var = session.query(Variable).filter(Variable.key == "key").one()
-        assert test_var.team_id == testing_team.id
+        assert test_var.team_name == testing_team.name
         assert test_var.val == "value"
 
     def test_set_variable_sets_team_multi_team_off(self, testing_team, session):
         with pytest.raises(ValueError, match=r"Multi-team mode is not configured in the Airflow environment"):
-            Variable.set(key="key", value="value", team_id=testing_team.id, session=session)
+            Variable.set(key="key", value="value", team_name=testing_team.name, session=session)
 
     def test_variable_set_existing_value_to_blank(self, session):
         test_value = "Some value"
@@ -330,20 +330,23 @@ def test_cache_invalidation_on_set(self, session):
         assert c != b
 
     def test_get_team_name(self, testing_team: Team, session: Session):
-        var = Variable(key="key", val="value", team_id=testing_team.id)
+        var = Variable(key="key", val="value", team_name=testing_team.name)
         session.add(var)
         session.flush()
 
         assert Variable.get_team_name("key", session=session) == "testing"
 
     def test_get_key_to_team_name_mapping(self, testing_team: Team, session: Session):
-        var1 = Variable(key="key1", val="value1", team_id=testing_team.id)
+        var1 = Variable(key="key1", val="value1", team_name=testing_team.name)
         var2 = Variable(key="key2", val="value2")
         session.add(var1)
         session.add(var2)
         session.flush()
 
-        assert Variable.get_key_to_team_name_mapping(["key1", "key2"], session=session) == {"key1": "testing"}
+        assert Variable.get_key_to_team_name_mapping(["key1", "key2"], session=session) == {
+            "key1": "testing",
+            "key2": None,
+        }
 
 
 @pytest.mark.parametrize(
diff --git a/airflow-ctl/src/airflowctl/api/datamodels/generated.py b/airflow-ctl/src/airflowctl/api/datamodels/generated.py
index 1cb5ac77dde1f..7a8cd4396baf5 100644
--- a/airflow-ctl/src/airflowctl/api/datamodels/generated.py
+++ b/airflow-ctl/src/airflowctl/api/datamodels/generated.py
@@ -914,6 +914,10 @@ class ValidationError(BaseModel):
     type: Annotated[str, Field(title="Error Type")]
 
 
+class TeamName(RootModel[str]):
+    root: Annotated[str, Field(max_length=50, title="Team Name")]
+
+
 class VariableBody(BaseModel):
     """
     Variable serializer for bodies.
@@ -925,7 +929,7 @@ class VariableBody(BaseModel):
     key: Annotated[str, Field(max_length=250, title="Key")]
     value: JsonValue
     description: Annotated[str | None, Field(title="Description")] = None
-    team_id: Annotated[UUID | None, Field(title="Team Id")] = None
+    team_name: Annotated[TeamName | None, Field(title="Team Name")] = None
 
 
 class VariableResponse(BaseModel):
@@ -937,7 +941,7 @@ class VariableResponse(BaseModel):
     value: Annotated[str, Field(title="Value")]
     description: Annotated[str | None, Field(title="Description")] = None
     is_encrypted: Annotated[bool, Field(title="Is Encrypted")]
-    team_id: Annotated[UUID | None, Field(title="Team Id")] = None
+    team_name: Annotated[str | None, Field(title="Team Name")] = None
 
 
 class VersionInfo(BaseModel):
diff --git a/devel-common/src/tests_common/pytest_plugin.py b/devel-common/src/tests_common/pytest_plugin.py
index cd83af125a1c9..39eb4fd2b9c7c 100644
--- a/devel-common/src/tests_common/pytest_plugin.py
+++ b/devel-common/src/tests_common/pytest_plugin.py
@@ -25,7 +25,6 @@
 import re
 import subprocess
 import sys
-import uuid
 import warnings
 from collections.abc import Callable, Generator
 from contextlib import ExitStack, suppress
@@ -2774,7 +2773,7 @@ def testing_team():
         with create_session() as session:
             team = session.query(Team).filter_by(name="testing").one_or_none()
             if not team:
-                team = Team(id=uuid.uuid4(), name="testing")
+                team = Team(name="testing")
                 session.add(team)
                 session.flush()
             yield team
