Joopi
Tabelle create - Druckversion

+- Joopi (https://forum.hermann-splitthoff.de)
+-- Forum: Forum und Webseite (https://forum.hermann-splitthoff.de/forumdisplay.php?fid=16)
+--- Forum: Migrationssammler (https://forum.hermann-splitthoff.de/forumdisplay.php?fid=44)
+--- Thema: Tabelle create (/showthread.php?tid=63)



Tabelle create - Joopi - 07-01-2023

Sofern ich Tabellen auf der Konsole anlege, benutze ich folgenden Befehl:

Code:
CREATE TABLE tabelle (
id integer NOT NULL auto_increment,
text varchar(30) NOT NULL,
beschreibung text NOT NULL,
erfasst datetime NOT NULL,
geaendert timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
primary key(id)) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Diese Darstellung ist nur exemplarisch. Wichtig sind für mich die beiden Felder mit Datumsangaben.