From 86aa6af7882f1225e2d7dde709ce84d6665318c0 Mon Sep 17 00:00:00 2001 From: natalia Date: Mon, 22 Jan 2024 13:44:17 +0100 Subject: [PATCH 1/2] fix: update tablename --- src/database.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/database.py b/src/database.py index ae3e2b7..ba7cada 100644 --- a/src/database.py +++ b/src/database.py @@ -45,7 +45,7 @@ class User(Base): name: Mapped[str] = mapped_column(String, name="name", unique=True) uid_number: Mapped[int] = mapped_column(name="uidnumber") gid_number: Mapped[int] = mapped_column( - ForeignKey("groups.gidnumber", onupdate="cascade"), + ForeignKey("ldapgroups.gidnumber", onupdate="cascade"), name="primarygroup", ) other_groups: Mapped[set] = mapped_column(GroupSet, name="othergroups") @@ -66,7 +66,7 @@ class User(Base): class Group(Base): - __tablename__ = "groups" + __tablename__ = "ldapgroups" id = mapped_column(Integer, primary_key=True) name: Mapped[str] = mapped_column(name="name", unique=True) @@ -80,11 +80,11 @@ class IncludeGroup(Base): id = mapped_column(Integer, primary_key=True) parent_group_id: Mapped[int] = mapped_column( - ForeignKey("groups.gidnumber", onupdate="cascade"), + ForeignKey("ldapgroups.gidnumber", onupdate="cascade"), name="parentgroupid", ) child_group_id: Mapped[int] = mapped_column( - ForeignKey("groups.gidnumber", onupdate="cascade"), + ForeignKey("ldapgroups.gidnumber", onupdate="cascade"), name="includegroupid", ) From bf86fc3100767c200e8ee5064aa4888dcc9f58e4 Mon Sep 17 00:00:00 2001 From: natalia Date: Thu, 25 Jan 2024 12:04:16 +0100 Subject: [PATCH 2/2] docs: update database schema image --- img/database_schema_diagram.svg | 331 ++++++++++++++++---------------- 1 file changed, 166 insertions(+), 165 deletions(-) diff --git a/img/database_schema_diagram.svg b/img/database_schema_diagram.svg index 37ef697..2e5d66b 100644 --- a/img/database_schema_diagram.svg +++ b/img/database_schema_diagram.svg @@ -1,122 +1,123 @@ - - - - - + + + +%3 + User - - -User - - -id - - -INTEGER (PK) - - -name - - -VARCHAR (Unique) - - -uidnumber - - -INTEGER () - - -primarygroup - - -INTEGER () - - -othergroups - - -TEXT () - - -givenname - - -VARCHAR () - - -sn - - -VARCHAR () - - -mail - - -VARCHAR () - - -loginshell - - -VARCHAR () - - -homedirectory - - -VARCHAR () - - -disabled - - -SMALLINT () - - -passsha256 - - -VARCHAR () - - -passbcrypt - - -VARCHAR () - - -otpsecret - - -VARCHAR () - - -yubikey - - -VARCHAR () - - -sshkeys - - -VARCHAR () - - -custattr - - -VARCHAR () + + +User + + +id + + +INTEGER (PK) + + +name + + +VARCHAR (Unique) + + +uidnumber + + +INTEGER () + + +primarygroup + + +INTEGER () + + +othergroups + + +TEXT () + + +givenname + + +VARCHAR () + + +sn + + +VARCHAR () + + +mail + + +VARCHAR () + + +loginshell + + +VARCHAR () + + +homedirectory + + +VARCHAR () + + +disabled + + +SMALLINT () + + +passsha256 + + +VARCHAR () + + +passbcrypt + + +VARCHAR () + + +otpsecret + + +VARCHAR () + + +yubikey + + +VARCHAR () + + +sshkeys + + +VARCHAR () + + +custattr + + +VARCHAR () @@ -124,27 +125,27 @@ Group - - -Group - - -id - - -INTEGER (PK) - - -name - - -VARCHAR (Unique) - - -gidnumber - - -INTEGER () + + +Group + + +id + + +INTEGER (PK) + + +name + + +VARCHAR (Unique) + + +gidnumber + + +INTEGER () @@ -152,47 +153,47 @@ User->Group - - + + -group +group Group->User - - + + -users +users IncludeGroup - - -IncludeGroup - - -id - - -INTEGER (PK) - - -parentgroupid - - -INTEGER () - - -includegroupid - - -INTEGER () + + +IncludeGroup + + +id + + +INTEGER (PK) + + +parentgroupid + + +INTEGER () + + +includegroupid + + +INTEGER () @@ -200,21 +201,21 @@ IncludeGroup->Group - - + + -parent_group +parent_group IncludeGroup->Group - - + + -child_group +child_group