Adapt to existing beos table in database sternwarte

Column mapping: id, name/vorname, kürzel (with umlaut), pw instead of
the planned schema. DB_NAME changed to sternwarte. create_table.sql
no longer creates beos, only the three new logbuch tables.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-27 17:34:45 +02:00
parent 4e53a7a5cd
commit 12be2f1db2
5 changed files with 25 additions and 24 deletions

View File

@@ -1,11 +1,5 @@
CREATE TABLE beos (
ID INT AUTO_INCREMENT PRIMARY KEY,
Kuerzel VARCHAR(10) NOT NULL UNIQUE,
Name VARCHAR(100) NOT NULL,
Passwort VARCHAR(255),
MustChangePassword TINYINT(1) DEFAULT 1,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Datenbank: sternwarte
-- Die Tabelle 'beos' ist bereits vorhanden und wird hier nicht neu angelegt.
CREATE TABLE objekte (
ID INT AUTO_INCREMENT PRIMARY KEY,
@@ -27,7 +21,7 @@ CREATE TABLE logbuch (
WetterDruck DECIMAL(7,1),
created_by INT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (created_by) REFERENCES beos(ID)
FOREIGN KEY (created_by) REFERENCES beos(id)
);
CREATE TABLE logbuch_beos (
@@ -35,7 +29,7 @@ CREATE TABLE logbuch_beos (
LogbuchID INT NOT NULL,
BeoID INT NOT NULL,
FOREIGN KEY (LogbuchID) REFERENCES logbuch(ID) ON DELETE CASCADE,
FOREIGN KEY (BeoID) REFERENCES beos(ID)
FOREIGN KEY (BeoID) REFERENCES beos(id)
);
CREATE TABLE logbuch_objekte (