🐛 fix first row of 'facture' being skipped

main
Shad Amethyst 2 years ago
parent 6cec2196cb
commit 6a67a02605

@ -0,0 +1,23 @@
DROP TABLE IF EXISTS facture;
CREATE TABLE facture (
numfacture INT NOT NULL AUTO_INCREMENT,
numtable INT NOT NULL,
numserveur INT NOT NULL,
datefacture DATE NOT NULL,
PRIMARY KEY (numfacture)
);
LOAD DATA LOCAL INFILE './cafe/facture.csv' INTO TABLE facture
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES
(
numfacture,
numtable,
numserveur,
@datefacture
)
SET datefacture = STR_TO_DATE(@datefacture, "%d-%b-%y");
-- TODO: other tables

@ -193,6 +193,7 @@ CREATE TABLE `facture` (
LOCK TABLES `facture` WRITE; LOCK TABLES `facture` WRITE;
/*!40000 ALTER TABLE `facture` DISABLE KEYS */; /*!40000 ALTER TABLE `facture` DISABLE KEYS */;
INSERT INTO `facture` VALUES INSERT INTO `facture` VALUES
(1000,1,53,'2005-12-01'),
(1001,5,53,'2005-12-02'), (1001,5,53,'2005-12-02'),
(1002,3,52,'2005-12-02'), (1002,3,52,'2005-12-02'),
(1003,5,50,'2005-12-04'), (1003,5,50,'2005-12-04'),
@ -305,4 +306,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2023-02-27 10:30:24 -- Dump completed on 2023-03-06 8:12:20

@ -1,3 +1,4 @@
"NUMFACTURE","NUMTABLE","NUMSERVEUR","DATEFACTURE"
1000,1,53,"01-DEC-05" 1000,1,53,"01-DEC-05"
1001,5,53,"02-DEC-05" 1001,5,53,"02-DEC-05"
1002,3,52,"02-DEC-05" 1002,3,52,"02-DEC-05"

1 1000 NUMFACTURE 1 NUMTABLE 53 NUMSERVEUR 01-DEC-05 DATEFACTURE
1 NUMFACTURE NUMTABLE NUMSERVEUR DATEFACTURE
2 1000 1000 1 1 53 53 01-DEC-05 01-DEC-05
3 1001 1001 5 5 53 53 02-DEC-05 02-DEC-05
4 1002 1002 3 3 52 52 02-DEC-05 02-DEC-05
Loading…
Cancel
Save