Skip to content

Feat/63 sql build tables - #70

Open
Wesley-Fos wants to merge 5 commits into
mainfrom
feat/63-sql-build-tables
Open

Wesley-Fos wants to merge 5 commits into
mainfrom
feat/63-sql-build-tables

Conversation

@Wesley-Fos

Copy link
Copy Markdown
Collaborator

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

  • [ x] I have performed a self-review of my code.
  • [ x] I have fulfilled all acceptance criteria.
  • [ x] All Tasks have been completed OR notes have been made on the ticket.
  • [ x] The solution builds.
  • [ x] 100% of tests pass with 80% code coverage from unit tests.
  • [ x] Documentation has been updated.

Wesley-Fos and others added 5 commits November 16, 2026 21:14
* 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>
@Wesley-Fos Wesley-Fos self-assigned this Nov 29, 2026
@Wesley-Fos Wesley-Fos added the feature New feature or request label Nov 29, 2026
Comment thread backend/init_tables.sql
@@ -0,0 +1,142 @@
-- defaults to innoDB in case future changes to mySQL
CREATE TABLE IF NOT EXISTS `User` (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

table name will need to be "Account" due to reserved key words

Comment thread backend/init_tables.sql
CREATE TABLE IF NOT EXISTS `User` (
`id` INT NOT NULL AUTO_INCREMENT,
`username` VARCHAR(255),
`passwordHash` VARCHAR(255),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread backend/init_tables.sql

CREATE TABLE IF NOT EXISTS `Tag` (
`id` INT NOT NULL AUTO_INCREMENT,
`label` VARCHAR(255),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't allow tags this long. How about 100 char?

Comment thread backend/init_tables.sql
CREATE TABLE IF NOT EXISTS `Sticker` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255),
`length` DOUBLE NOT NULL,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread backend/init_tables.sql
`name` VARCHAR(255),
`length` DOUBLE NOT NULL,
`width` DOUBLE NOT NULL,
`desc` VARCHAR(255),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest increasing this to 500char

Comment thread backend/init_tables.sql
`id` INT NOT NULL AUTO_INCREMENT,
`customerId` INT,
`placementTimestamp` TIMESTAMP(6),
`status` VARCHAR(255),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe mysql supports enums. If it doesn't, this can still be shrunk to like 50char or less

Comment thread backend/init_tables.sql
`status` VARCHAR(255),
`addressJSON` LONGTEXT,
`note` VARCHAR(255),
`address` LONGTEXT,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment above about JSON fields

Comment thread backend/init_tables.sql
CREATE TABLE IF NOT EXISTS `OrderItemsStatus` (
`id` INT NOT NULL AUTO_INCREMENT,
`orderItemsId` INT,
`complete` TINYINT(1) NOT NULL,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you can set a default value of false

Comment thread backend/init_tables.sql
`id` INT NOT NULL AUTO_INCREMENT,
`orderId` INT,
`timestamp` TIMESTAMP(6),
`orderType` VARCHAR(255),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above about enums

Comment thread backend/init_tables.sql
@@ -0,0 +1,142 @@
-- defaults to innoDB in case future changes to mySQL

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing StagingItems table

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants