Skip to content

Commit

Permalink
feat: add model
Browse files Browse the repository at this point in the history
  • Loading branch information
WoodenMaiden committed Apr 9, 2024
1 parent 0b4d6f2 commit 1021830
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
14 changes: 14 additions & 0 deletions database/functionState.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package database

import (
"gorm.io/gorm"
"github.com/google/uuid"
)

type FunctionState struct {
gorm.Model
ID uuid.UUID `gorm:"primarykey;type:uuid;default:gen_random_uuid()"`
Code string
Status string
// OwnerID
}
2 changes: 1 addition & 1 deletion database/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

// put
var (
models = []interface{}{&User{}}
models = []interface{}{&User{}, &FunctionState{}}
)

func Init() *gorm.DB {
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
)

require (
github.com/google/uuid v1.6.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect
github.com/jackc/pgx/v5 v5.5.5 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVI
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 h1:L0QtFUgDarD7Fpv9jeVMgy/+Ec0mtnmYuImjTz6dtDA=
Expand Down

0 comments on commit 1021830

Please sign in to comment.