Hallo,
Ich wollte gerade meine Datenbank neumachen und habe volgenden SQL-Command verwendet:
SQL
CREATE TABLE IF NOT EXISTS `players` (
`uid` int(6) NOT NULL AUTO_INCREMENT,
`name` varchar(32) NOT NULL,
`aliases` text NOT NULL,
`pid` varchar(17) NOT NULL,
`cash` int(100) NOT NULL DEFAULT '0',
`bankacc` int(100) NOT NULL DEFAULT '0',
`coplevel` enum('0','1','2','3','4','5','6','7') NOT NULL DEFAULT '0',
`mediclevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
`civ_licenses` text NOT NULL,
`cop_licenses` text NOT NULL,
`med_licenses` text NOT NULL,
`civ_gear` text NOT NULL,
`cop_gear` text NOT NULL,
`med_gear` text NOT NULL,
`civ_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
`cop_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
`med_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
`arrested` tinyint(1) NOT NULL DEFAULT '0',
`adminlevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
`donorlevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
`blacklist` tinyint(1) NOT NULL DEFAULT '0',
`civ_alive` tinyint(1) NOT NULL DEFAULT '0',
`civ_position` varchar(64) NOT NULL DEFAULT '"[]"',
`playtime` varchar(32) NOT NULL DEFAULT '"[0,0,0]"',
`insert_time` timestamp DEFAULT CURRENT_TIMESTAMP,
`last_seen` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`uid`),
UNIQUE KEY `pid` (`pid`),
KEY `name` (`name`),
KEY `blacklist` (`blacklist`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=12 ;
-- --------------------------------------------------------
--
-- Table structure for table `vehicles`
--
CREATE TABLE IF NOT EXISTS `vehicles` (
`id` int(6) NOT NULL AUTO_INCREMENT,
`side` varchar(16) NOT NULL,
`classname` varchar(64) NOT NULL,
`type` varchar(16) NOT NULL,
`pid` varchar(17) NOT NULL,
`alive` tinyint(1) NOT NULL DEFAULT '1',
`blacklist` tinyint(1) NOT NULL DEFAULT '0',
`active` tinyint(1) NOT NULL DEFAULT '0',
`plate` int(20) NOT NULL,
`color` int(20) NOT NULL,
`inventory` text NOT NULL,
`gear` text NOT NULL,
`fuel` double NOT NULL DEFAULT '1',
`damage` varchar(256) NOT NULL,
`insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `side` (`side`),
KEY `pid` (`pid`),
KEY `type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=2 ;
-- --------------------------------------------------------
--
-- Table structure for table `houses`
-- Needed for extDB latest update on git
--
CREATE TABLE IF NOT EXISTS `houses` (
`id` int(6) NOT NULL AUTO_INCREMENT,
`pid` varchar(17) NOT NULL,
`pos` varchar(64) DEFAULT NULL,
`owned` tinyint(1) DEFAULT '0',
`garage` tinyint(1) NOT NULL DEFAULT '0',
`insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`,`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=4 ;
-- --------------------------------------------------------
--
-- Table structure for table `gangs`
-- Needed for extDB latest update on git
--
CREATE TABLE IF NOT EXISTS `gangs` (
`id` int(6) NOT NULL AUTO_INCREMENT,
`owner` varchar(32) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL,
`members` text,
`maxmembers` int(3) DEFAULT '8',
`bank` int(100) DEFAULT '0',
`active` tinyint(1) DEFAULT '1',
`insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `name_UNIQUE` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `containers`
-- Needed for extDB latest update on git
--
CREATE TABLE IF NOT EXISTS `containers` (
`id` int(6) NOT NULL AUTO_INCREMENT,
`pid` varchar(17) NOT NULL,
`classname` varchar(32) NOT NULL,
`pos` varchar(64) DEFAULT NULL,
`inventory` text NOT NULL,
`gear` text NOT NULL,
`dir` varchar(128) DEFAULT NULL,
`active` tinyint(1) NOT NULL DEFAULT '0',
`owned` tinyint(1) DEFAULT '0',
`insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`,`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=4;
-- --------------------------------------------------------
--
-- Table structure for table `wanted`
-- Needed for extDB latest update on git
--
CREATE TABLE IF NOT EXISTS `wanted` (
`wantedID` varchar(64) NOT NULL,
`wantedName` varchar(32) NOT NULL,
`wantedCrimes` text NOT NULL,
`wantedBounty` int(100) NOT NULL,
`active` tinyint(1) NOT NULL DEFAULT '0',
`insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`wantedID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Alles anzeigen
Bekomme allerding folgenden Fehler angezeigt:
FEHLER
Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
Kann mir da eventuell jemand helfen?
Ich vermute mal das der Fehler mit folgendem Code zusammen hängt:
SQL
CREATE TABLE IF NOT EXISTS `players` (
`uid` int(6) NOT NULL AUTO_INCREMENT,
`name` varchar(32) NOT NULL,
`aliases` text NOT NULL,
`pid` varchar(17) NOT NULL,
`cash` int(100) NOT NULL DEFAULT '0',
`bankacc` int(100) NOT NULL DEFAULT '0',
`coplevel` enum('0','1','2','3','4','5','6','7') NOT NULL DEFAULT '0',
`mediclevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
`civ_licenses` text NOT NULL,
`cop_licenses` text NOT NULL,
`med_licenses` text NOT NULL,
`civ_gear` text NOT NULL,
`cop_gear` text NOT NULL,
`med_gear` text NOT NULL,
`civ_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
`cop_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
`med_stats` varchar(32) NOT NULL DEFAULT '"[100,100,0]"',
`arrested` tinyint(1) NOT NULL DEFAULT '0',
`adminlevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
`donorlevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0',
`blacklist` tinyint(1) NOT NULL DEFAULT '0',
`civ_alive` tinyint(1) NOT NULL DEFAULT '0',
`civ_position` varchar(64) NOT NULL DEFAULT '"[]"',
`playtime` varchar(32) NOT NULL DEFAULT '"[0,0,0]"',
`insert_time` timestamp DEFAULT CURRENT_TIMESTAMP,
`last_seen` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`uid`),
UNIQUE KEY `pid` (`pid`),
KEY `name` (`name`),
KEY `blacklist` (`blacklist`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=12 ;
Alles anzeigen
Danke im voraus
MfG
Jan