Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
new types
Browse files Browse the repository at this point in the history
  • Loading branch information
gtsaturyan committed May 29, 2024
1 parent cb88133 commit 9100856
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 8 deletions.
18 changes: 16 additions & 2 deletions backend/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -762,12 +762,26 @@ const docTemplate = `{
"enum": [
"computer",
"camera",
"printer"
"printer",
"scanner",
"phone",
"smart_bulb",
"smart_fridge",
"custom",
"raspberry_pi",
"machine_tool"
],
"x-enum-varnames": [
"DeviceTypeComputer",
"DeviceTypeCamera",
"DeviceTypePrinter"
"DeviceTypePrinter",
"DeviceTypeScanner",
"DeviceTypePhone",
"DeviceTypeSmartBulb",
"DeviceTypeSmartFridge",
"DeviceTypeCustom",
"DeviceTypeRaspberryPi",
"DeviceTypeMachineTool"
]
},
"backend_internal_entity.CreateDevice": {
Expand Down
18 changes: 16 additions & 2 deletions backend/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -755,12 +755,26 @@
"enum": [
"computer",
"camera",
"printer"
"printer",
"scanner",
"phone",
"smart_bulb",
"smart_fridge",
"custom",
"raspberry_pi",
"machine_tool"
],
"x-enum-varnames": [
"DeviceTypeComputer",
"DeviceTypeCamera",
"DeviceTypePrinter"
"DeviceTypePrinter",
"DeviceTypeScanner",
"DeviceTypePhone",
"DeviceTypeSmartBulb",
"DeviceTypeSmartFridge",
"DeviceTypeCustom",
"DeviceTypeRaspberryPi",
"DeviceTypeMachineTool"
]
},
"backend_internal_entity.CreateDevice": {
Expand Down
14 changes: 14 additions & 0 deletions backend/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,25 @@ definitions:
- computer
- camera
- printer
- scanner
- phone
- smart_bulb
- smart_fridge
- custom
- raspberry_pi
- machine_tool
type: string
x-enum-varnames:
- DeviceTypeComputer
- DeviceTypeCamera
- DeviceTypePrinter
- DeviceTypeScanner
- DeviceTypePhone
- DeviceTypeSmartBulb
- DeviceTypeSmartFridge
- DeviceTypeCustom
- DeviceTypeRaspberryPi
- DeviceTypeMachineTool
backend_internal_entity.CreateDevice:
properties:
angle:
Expand Down
22 changes: 18 additions & 4 deletions backend/internal/dbmodel/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions backend/migrations/20240529225442_add_new_type.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-- +goose Up
-- +goose StatementBegin
ALTER TYPE device_type
ADD VALUE 'scanner';
ALTER TYPE device_type
ADD VALUE 'phone';
ALTER TYPE device_type
ADD VALUE 'smart_bulb';
ALTER TYPE device_type
ADD VALUE 'smart_fridge';
ALTER TYPE device_type
ADD VALUE 'custom';
ALTER TYPE device_type
ADD VALUE 'raspberry_pi';
ALTER TYPE device_type
ADD VALUE 'machine_tool';
-- +goose StatementEnd

-- +goose Down
-- +goose StatementBegin
DROP TYPE device_type;
CREATE TYPE device_type AS ENUM (
'computer', 'camera', 'printer'
);
-- +goose StatementEnd

0 comments on commit 9100856

Please sign in to comment.