-
Notifications
You must be signed in to change notification settings - Fork 13
Add MillingStep table #323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| -- To undo: | ||
| -- drop table MillingStep; | ||
| -- drop table MillingStepName; | ||
| -- delete from SchemaStatus where scriptName = '2026_05_08_MillingStep_table.sql'; | ||
|
|
||
|
|
||
| INSERT IGNORE INTO SchemaStatus (scriptName, schemaStatus) VALUES ('2026_05_08_MillingStep_table.sql', 'ONGOING'); | ||
|
|
||
| CREATE TABLE MillingStepName ( | ||
| millingStepNameId int(11) unsigned PRIMARY KEY AUTO_INCREMENT, | ||
| step varchar(45) NOT NULL, | ||
| recipe varchar(45) NOT NULL | ||
| ) COMMENT "Milling step names and recipes"; | ||
|
|
||
| INSERT INTO MillingStepName (step, recipe) VALUES | ||
| ("Eucentric Tilt", "Preparation"), | ||
| ("Artificial Features", "Preparation"), | ||
| ("Milling Angle", "Preparation"), | ||
| ("Image Acquisition", "Preparation"), | ||
| ("Lamella Placement", "Preparation"), | ||
| ("Milling", "Preparation"), | ||
| ("Delay", "Milling"), | ||
| ("Reference Definition", "Milling"), | ||
| ("Electron Reference Definition", "Milling"), | ||
| ("Stress Relief Cuts", "Milling"), | ||
| ("Reference Redefinition 1", "Milling"), | ||
| ("Rough Milling", "Milling"), | ||
| ("Rough Milling - Electron Image", "Milling"), | ||
| ("Reference Redefinition 2", "Milling"), | ||
| ("Medium Milling", "Milling"), | ||
| ("Medium Milling - Electron Image", "Milling"), | ||
| ("Fine Milling", "Milling"), | ||
| ("Fine Milling - Electron Image", "Milling"), | ||
| ("Finer Milling", "Milling"), | ||
| ("Finer Milling - Electron Image", "Milling"), | ||
| ("Thinning", "Milling"), | ||
| ("Delay", "Thinning"), | ||
| ("Polishing 1", "Thinning"), | ||
| ("Polishing 1 - Electron Image", "Thinning"), | ||
| ("Polishing 2", "Thinning"), | ||
| ("Polishing 2 - Ion Image", "Thinning"), | ||
| ("Polishing 2 - Electron Image", "Thinning"); | ||
|
|
||
| CREATE TABLE MillingStep ( | ||
| millingStepId int(11) unsigned PRIMARY KEY AUTO_INCREMENT, | ||
| millingStepNameId int(11) unsigned, | ||
| isEnabled tinyint(1) DEFAULT 0 COMMENT "This marks whether the milling step is enabled and queued up; when the FIB starts this step, it will be set to False", | ||
| status enum("Finished", "Failed", "Aborted") COMMENT "Describes the status of the milling step", | ||
| executionTime float COMMENT "The time in seconds the step took to complete", | ||
| stageX float COMMENT "Stage position in metres", | ||
| stageY float COMMENT "Stage position in metres", | ||
| stageZ float COMMENT "Stage position in metres", | ||
| rotation float COMMENT "Rotation of stage in xy plane in degrees", | ||
| alphaTilt float COMMENT "Unit: degrees", | ||
| beamType enum("Electron", "Ion") COMMENT "Type of beam used", | ||
| beamVoltage float COMMENT "Unit: volts", | ||
| beamCurrent float COMMENT "Unit: amperes", | ||
| millingAngle float COMMENT "The angle the stage is tilted to for milling, in degrees", | ||
| depthCorrection float, | ||
| lamellaOffset float COMMENT "Unit: metres", | ||
| trenchHeightFront float COMMENT "Unit: metres", | ||
| trenchHeightRear float COMMENT "Unit: metres", | ||
| widthOverlapFrontLeft float COMMENT "Unit: metres", | ||
| widthOverlapFrontRight float COMMENT "Unit: metres", | ||
| widthOverlapRearLeft float COMMENT "Unit: metres", | ||
| widthOverlapRearRight float COMMENT "Unit: metres", | ||
| gridSquareId int(11) unsigned NOT NULL, | ||
| CONSTRAINT MillingStep_fk_gridSquareId | ||
| FOREIGN KEY (gridSquareId) | ||
| REFERENCES GridSquare (gridSquareId) | ||
| ON DELETE CASCADE | ||
| ON UPDATE CASCADE, | ||
| CONSTRAINT MillingStep_fk_millingStepNameId | ||
| FOREIGN KEY (millingStepNameId) | ||
| REFERENCES MillingStepName (millingStepNameId) | ||
| ON DELETE CASCADE | ||
| ON UPDATE CASCADE | ||
| ) COMMENT = "FIB Milling Step"; | ||
|
|
||
| UPDATE SchemaStatus SET schemaStatus = 'DONE' WHERE scriptName = '2026_05_08_MillingStep_table.sql'; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"None"also appears in the metadata as a possible string literal. Would you rather we insertnullinstead of"None"in that instance?Also, correct me if I'm wrong, but if
statuswas previously populated with a string, we can set it tonullagain, right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes, I though that when you mentioned "None", it was functionally equivalent to "null", but if there is some distinction, I can readd it
Status should only accept enums, so since the table doesn't exist yet, it'll only accept
enumsAlso, I remember there was one column in
GridSquarethat you may want to add, is that still the case?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking back on our previous chats, I think we no longer need that for this batch of changes.
Ah, I see. Unselected steps will have
"None"as their activity status, and there might be an off chance that something will go from one of the known options back to"None". Thestatuscolumn would thus need to support the insertion ofnull,"None", or"", whichever one is easier from an SQL perspective.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of them are equally easy, it remains nullable, so you'll be able to set it to "null" and enums, but not strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thanks for clarifying! We can go with the
nulloption, then.