-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Creato il: Ott 24, 2021 alle 15:49
-- Versione del server: 5.7.28
-- Versione PHP: 7.3.12

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `syscrawler`
--
CREATE DATABASE IF NOT EXISTS syscrawler;
USE syscrawler;



--
-- Struttura della tabella `sysinfo`
--

DROP TABLE IF EXISTS `sysinfo`;
CREATE TABLE IF NOT EXISTS `sysinfo` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `serialnumberpc` varchar(256) COLLATE utf8_bin NOT NULL,
  `data` datetime NOT NULL,
  `parametrosys` text COLLATE utf8_bin NOT NULL,
  `valoresys` text COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sysinfo` (`serialnumberpc`,`data`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS `wininfo`;
CREATE TABLE IF NOT EXISTS `wininfo` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `serialnumberpc` varchar(256) COLLATE utf8_bin NOT NULL,
  `data` datetime NOT NULL,
  `parametrowin` text COLLATE utf8_bin NOT NULL,
  `valorewin` text COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`),
  KEY `wininfo` (`serialnumberpc`,`data`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS `listadispositiviusb`;
CREATE TABLE IF NOT EXISTS `listadispositiviusb` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `serialnumberpc` varchar(256) COLLATE utf8_bin NOT NULL,
  `data` datetime NOT NULL,
  `parametrousb` text COLLATE utf8_bin NOT NULL,
  `valoreusb` text COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`),
  KEY `listadispositiviusb` (`serialnumberpc`,`data`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS `cpu`;
CREATE TABLE IF NOT EXISTS `cpu` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `serialnumberpc` varchar(256) COLLATE utf8_bin NOT NULL,
  `data` datetime NOT NULL,
  `parametrocpu` text COLLATE utf8_bin NOT NULL,
  `valorecpu` text COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`),
  KEY `cpu` (`serialnumberpc`,`data`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS `ram`;
CREATE TABLE IF NOT EXISTS `ram` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `serialnumberpc` varchar(256) COLLATE utf8_bin NOT NULL,
  `data` datetime NOT NULL,
  `parametroram` text COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`),
  KEY `ram` (`serialnumberpc`,`data`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS `schedevideo`;
CREATE TABLE IF NOT EXISTS `schedevideo` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `serialnumberpc` varchar(256) COLLATE utf8_bin NOT NULL,
  `data` datetime NOT NULL,
  `parametroschedavideo` text COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`),
  KEY `parametroschedavideo` (`serialnumberpc`,`data`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS `hd`;
CREATE TABLE IF NOT EXISTS `hd` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `serialnumberpc` varchar(256) COLLATE utf8_bin NOT NULL,
  `data` datetime NOT NULL,
  `unita` text COLLATE utf8_bin NOT NULL,
  `dimensione` text COLLATE utf8_bin NOT NULL,
  `Spazio_libero` text COLLATE utf8_bin NOT NULL,
  `rimovibile` text COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`),
  KEY `hd` (`serialnumberpc`,`data`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS `audio`;
CREATE TABLE IF NOT EXISTS `audio` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `serialnumberpc` varchar(256) COLLATE utf8_bin NOT NULL,
  `data` datetime NOT NULL,
  `parametroaudio` text COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`),
  KEY `audio` (`serialnumberpc`,`data`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS `scsi`;
CREATE TABLE IF NOT EXISTS `scsi` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `serialnumberpc` varchar(256) COLLATE utf8_bin NOT NULL,
  `data` datetime NOT NULL,
  `parametroscsi` text COLLATE utf8_bin NOT NULL,
  `valorescsi` text COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`),
  KEY `scsi` (`serialnumberpc`,`data`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS `stampanti`;
CREATE TABLE IF NOT EXISTS `stampanti` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `serialnumberpc` varchar(256) COLLATE utf8_bin NOT NULL,
  `data` datetime NOT NULL,
  `valorestampanti` text COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`),
  KEY `stampanti` (`serialnumberpc`,`data`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS `software`;
CREATE TABLE IF NOT EXISTS `software` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `serialnumberpc` varchar(256) COLLATE utf8_bin NOT NULL,
  `data` datetime NOT NULL,
  `architettura` text COLLATE utf8_bin NOT NULL,
  `DisplayName` text COLLATE utf8_bin NOT NULL,
  `DisplayVersion` text COLLATE utf8_bin NOT NULL,
  `Publisher` text COLLATE utf8_bin NOT NULL,
  `InstallSource` text COLLATE utf8_bin NOT NULL,
  `InstallLocation` text COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`),
  KEY `software` (`serialnumberpc`,`data`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS `autostart`;
CREATE TABLE IF NOT EXISTS `autostart` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `serialnumberpc` varchar(256) COLLATE utf8_bin NOT NULL,
  `data` datetime NOT NULL,
  `parametroautostart` text COLLATE utf8_bin NOT NULL,
  `valoreautostart` text COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`),
  KEY `autostart` (`serialnumberpc`,`data`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS `autostartservizi`;
CREATE TABLE IF NOT EXISTS `autostartservizi` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `serialnumberpc` varchar(256) COLLATE utf8_bin NOT NULL,
  `data` datetime NOT NULL,
  `NomeChiaveCorrente` text COLLATE utf8_bin NOT NULL,
  `valoreDisplayName` text COLLATE utf8_bin NOT NULL,
  `valoreImagePath` text COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`),
  KEY `autostartservizi` (`serialnumberpc`,`data`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


--
-- Struttura della tabella `main`
--

DROP TABLE IF EXISTS `main`;
CREATE TABLE IF NOT EXISTS `main` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `serialnumberpc` varchar(256) COLLATE utf8_bin NOT NULL,
  `data` datetime NOT NULL,
  `nomepc` varchar(256) COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`serialnumberpc`,`data`),
  UNIQUE KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- 
--
-- Limiti per le tabelle scaricate
--

--
-- Limiti per la tabella `sysinfo`
--
ALTER TABLE `sysinfo`
  ADD CONSTRAINT `sysinfo` FOREIGN KEY (`serialnumberpc`,`data`) REFERENCES `main` (`serialnumberpc`, `data`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
ALTER TABLE `wininfo`
  ADD CONSTRAINT `wininfo` FOREIGN KEY (`serialnumberpc`,`data`) REFERENCES `main` (`serialnumberpc`, `data`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
ALTER TABLE `listadispositiviusb`
  ADD CONSTRAINT `listadispositiviusb` FOREIGN KEY (`serialnumberpc`,`data`) REFERENCES `main` (`serialnumberpc`, `data`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
ALTER TABLE `cpu`
  ADD CONSTRAINT `cpu` FOREIGN KEY (`serialnumberpc`,`data`) REFERENCES `main` (`serialnumberpc`, `data`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
ALTER TABLE `ram`
  ADD CONSTRAINT `ram` FOREIGN KEY (`serialnumberpc`,`data`) REFERENCES `main` (`serialnumberpc`, `data`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
ALTER TABLE `schedevideo`
  ADD CONSTRAINT `schedevideo` FOREIGN KEY (`serialnumberpc`,`data`) REFERENCES `main` (`serialnumberpc`, `data`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
ALTER TABLE `hd`
  ADD CONSTRAINT `hd` FOREIGN KEY (`serialnumberpc`,`data`) REFERENCES `main` (`serialnumberpc`, `data`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
ALTER TABLE `audio`
  ADD CONSTRAINT `audio` FOREIGN KEY (`serialnumberpc`,`data`) REFERENCES `main` (`serialnumberpc`, `data`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
ALTER TABLE `scsi`
  ADD CONSTRAINT `scsi` FOREIGN KEY (`serialnumberpc`,`data`) REFERENCES `main` (`serialnumberpc`, `data`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
ALTER TABLE `stampanti`
  ADD CONSTRAINT `stampanti` FOREIGN KEY (`serialnumberpc`,`data`) REFERENCES `main` (`serialnumberpc`, `data`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
ALTER TABLE `software`
  ADD CONSTRAINT `software` FOREIGN KEY (`serialnumberpc`,`data`) REFERENCES `main` (`serialnumberpc`, `data`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
ALTER TABLE `autostart`
  ADD CONSTRAINT `autostart` FOREIGN KEY (`serialnumberpc`,`data`) REFERENCES `main` (`serialnumberpc`, `data`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
ALTER TABLE `autostartservizi`
  ADD CONSTRAINT `autostartservizi` FOREIGN KEY (`serialnumberpc`,`data`) REFERENCES `main` (`serialnumberpc`, `data`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;



/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
