Repository navigation
Feat/63 sql build tables - #70
Wesley-Fos wants to merge 5 commits into
Conversation
* starter class creation * Started hibernate classes * more progress on Order and OrderItems hibernate classes * added and expended OrderItems and Tag classes * feat(backend): add user/permission/permissiontype hibernate classes * Updated Tag and TagItems entity classes, updated Collection and CollectionItems classes, created StickerSheets class * Added getters and setters to some classes, created attribute converter classes * finished building up hibernate classes * OrderItemsStatus class --------- Co-authored-by: kathryn-eckert <kathryneckert719@gmail.com> Co-authored-by: yu-ziyi <ziyiyu123@gmail.com>
| @@ -0,0 +1,142 @@ | |||
| -- defaults to innoDB in case future changes to mySQL | |||
| CREATE TABLE IF NOT EXISTS `User` ( | |||
There was a problem hiding this comment.
table name will need to be "Account" due to reserved key words
| CREATE TABLE IF NOT EXISTS `User` ( | ||
| `id` INT NOT NULL AUTO_INCREMENT, | ||
| `username` VARCHAR(255), | ||
| `passwordHash` VARCHAR(255), |
There was a problem hiding this comment.
the size needed for this depends on our algorithm, I haven't been able to find an exact number. All of this to say it may have to change someday
|
|
||
| CREATE TABLE IF NOT EXISTS `Tag` ( | ||
| `id` INT NOT NULL AUTO_INCREMENT, | ||
| `label` VARCHAR(255), |
There was a problem hiding this comment.
We shouldn't allow tags this long. How about 100 char?
| CREATE TABLE IF NOT EXISTS `Sticker` ( | ||
| `id` INT NOT NULL AUTO_INCREMENT, | ||
| `name` VARCHAR(255), | ||
| `length` DOUBLE NOT NULL, |
There was a problem hiding this comment.
The m,n in the ERD is important because it specifies the exact size of double we expect and creates a max and min cap on value. I set the range for this field at 5 total digits with up to 2 points precision, which gives a range of -999.99 to 999.99
| `name` VARCHAR(255), | ||
| `length` DOUBLE NOT NULL, | ||
| `width` DOUBLE NOT NULL, | ||
| `desc` VARCHAR(255), |
There was a problem hiding this comment.
I suggest increasing this to 500char
| `id` INT NOT NULL AUTO_INCREMENT, | ||
| `customerId` INT, | ||
| `placementTimestamp` TIMESTAMP(6), | ||
| `status` VARCHAR(255), |
There was a problem hiding this comment.
I believe mysql supports enums. If it doesn't, this can still be shrunk to like 50char or less
| `status` VARCHAR(255), | ||
| `addressJSON` LONGTEXT, | ||
| `note` VARCHAR(255), | ||
| `address` LONGTEXT, |
There was a problem hiding this comment.
see comment above about JSON fields
| CREATE TABLE IF NOT EXISTS `OrderItemsStatus` ( | ||
| `id` INT NOT NULL AUTO_INCREMENT, | ||
| `orderItemsId` INT, | ||
| `complete` TINYINT(1) NOT NULL, |
There was a problem hiding this comment.
I believe you can set a default value of false
| `id` INT NOT NULL AUTO_INCREMENT, | ||
| `orderId` INT, | ||
| `timestamp` TIMESTAMP(6), | ||
| `orderType` VARCHAR(255), |
There was a problem hiding this comment.
see above about enums
| @@ -0,0 +1,142 @@ | |||
| -- defaults to innoDB in case future changes to mySQL | |||
There was a problem hiding this comment.
Missing StagingItems table
Describe your changes
sql script for initializing the tables needed for the backend.
Issue/Story ticket number and link
#63
Checklist before requesting a review