|
| 1 | +-- To undo: |
| 2 | +-- drop table LaserPoint; |
| 3 | +-- drop table LaserParameters; |
| 4 | +-- delete from SchemaStatus where scriptName = '2025_11_03_LaserParameters_tables.sql'; |
| 5 | + |
| 6 | + |
| 7 | +INSERT IGNORE INTO SchemaStatus (scriptName, schemaStatus) VALUES ('2025_11_03_LaserParameters_tables.sql', 'ONGOING'); |
| 8 | + |
| 9 | +CREATE TABLE LaserParameters ( |
| 10 | + laserParametersId int(11) unsigned PRIMARY KEY AUTO_INCREMENT, |
| 11 | + robotActionId int(11) unsigned, |
| 12 | + laserRepetitionRate float COMMENT 'Laser repetition rate, in kHz', |
| 13 | + scanheadMoveSpeed float COMMENT 'Scanhead move speed, in m/s', |
| 14 | + laserTransmission float COMMENT 'Laser transmission, in %', |
| 15 | + numberOfPasses int(10) unsigned, |
| 16 | + gonioRotationSpeed int(10) COMMENT 'Goniometer rotation speed, in deg/s', |
| 17 | + totalMarkingTime float COMMENT 'Total marking time, in s', |
| 18 | + CONSTRAINT `LaserParameters_fk_robotActionId` |
| 19 | + FOREIGN KEY (robotActionId) |
| 20 | + REFERENCES RobotAction (robotActionId) |
| 21 | + ON DELETE CASCADE |
| 22 | + ON UPDATE CASCADE |
| 23 | +) COMMENT = 'Laser parameters'; |
| 24 | + |
| 25 | +CREATE TABLE LaserPoint ( |
| 26 | + laserPointId int(11) unsigned PRIMARY KEY AUTO_INCREMENT, |
| 27 | + laserParametersId int(11) unsigned, |
| 28 | + x int(10) unsigned NOT NULL COMMENT 'X coordinate of point, in microns', |
| 29 | + y int(10) unsigned NOT NULL COMMENT 'Y coordinate of point, in microns', |
| 30 | + pointIndex int(10) NOT NULL COMMENT 'Index of point, expresses ordinality', |
| 31 | + radius int(10) unsigned COMMENT 'Radius of point, in microns', |
| 32 | + laserOn tinyint(1) DEFAULT 0, |
| 33 | + CONSTRAINT LaserPoint_fk_laserParametersId |
| 34 | + FOREIGN KEY (laserParametersId) |
| 35 | + REFERENCES LaserParameters (laserParametersId) |
| 36 | + ON DELETE CASCADE |
| 37 | + ON UPDATE CASCADE |
| 38 | +) COMMENT = 'Laser points'; |
| 39 | + |
| 40 | +UPDATE SchemaStatus SET schemaStatus = 'DONE' WHERE scriptName = '2025_11_03_LaserParameters_tables.sql'; |
0 commit comments