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 747bbb2
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 8 deletions.
16 changes: 14 additions & 2 deletions backend/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -762,12 +762,24 @@ const docTemplate = `{
"enum": [
"computer",
"camera",
"printer"
"printer",
"scanner",
"phone",
"smart_bulb",
"smart_fridge",
"custom",
"raspberry_pi"
],
"x-enum-varnames": [
"DeviceTypeComputer",
"DeviceTypeCamera",
"DeviceTypePrinter"
"DeviceTypePrinter",
"DeviceTypeScanner",
"DeviceTypePhone",
"DeviceTypeSmartBulb",
"DeviceTypeSmartFridge",
"DeviceTypeCustom",
"DeviceTypeRaspberryPi"
]
},
"backend_internal_entity.CreateDevice": {
Expand Down
16 changes: 14 additions & 2 deletions backend/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -755,12 +755,24 @@
"enum": [
"computer",
"camera",
"printer"
"printer",
"scanner",
"phone",
"smart_bulb",
"smart_fridge",
"custom",
"raspberry_pi"
],
"x-enum-varnames": [
"DeviceTypeComputer",
"DeviceTypeCamera",
"DeviceTypePrinter"
"DeviceTypePrinter",
"DeviceTypeScanner",
"DeviceTypePhone",
"DeviceTypeSmartBulb",
"DeviceTypeSmartFridge",
"DeviceTypeCustom",
"DeviceTypeRaspberryPi"
]
},
"backend_internal_entity.CreateDevice": {
Expand Down
12 changes: 12 additions & 0 deletions backend/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,23 @@ definitions:
- computer
- camera
- printer
- scanner
- phone
- smart_bulb
- smart_fridge
- custom
- raspberry_pi
type: string
x-enum-varnames:
- DeviceTypeComputer
- DeviceTypeCamera
- DeviceTypePrinter
- DeviceTypeScanner
- DeviceTypePhone
- DeviceTypeSmartBulb
- DeviceTypeSmartFridge
- DeviceTypeCustom
- DeviceTypeRaspberryPi
backend_internal_entity.CreateDevice:
properties:
angle:
Expand Down
20 changes: 16 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.

23 changes: 23 additions & 0 deletions backend/migrations/20240529225442_add_new_type.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
-- +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';
-- +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 747bbb2

Please sign in to comment.