CREATE TABLE `adminsettings` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `value` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `visits` (
  `id` int(11) NOT NULL,
  `username` varchar(255) NOT NULL DEFAULT '0',
  `kmstart` varchar(255) NOT NULL DEFAULT '0',
  `kmend` varchar(255) NOT NULL DEFAULT '0',
  `zipcode` varchar(255) NOT NULL DEFAULT '0',
  `zipcode0` varchar(255) NOT NULL DEFAULT '0',
  `city` varchar(255) NOT NULL DEFAULT '0',
  `kmnotes` varchar(255) NOT NULL DEFAULT '0',
  `privatekm` varchar(255) NOT NULL DEFAULT '0',
  `carplate` varchar(255) NOT NULL DEFAULT '0',
  `jobtype` varchar(255) NOT NULL DEFAULT '0',
  `jobno` varchar(255) NOT NULL DEFAULT '0',
  `jobmaterials` text NOT NULL DEFAULT '0',
  `jobwork` text NOT NULL DEFAULT '0',
  `jobfinish` text NOT NULL DEFAULT '0',
  `drivedpriv` varchar(255) NOT NULL DEFAULT '0',
  `reg_date` varchar(255) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

ALTER TABLE `adminsettings`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `visits`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `adminsettings`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `visits`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;