Skip to content

Commit

Permalink
delete mutations (#41)
Browse files Browse the repository at this point in the history
fixes #41
  • Loading branch information
dheidemann committed Jul 18, 2024
1 parent 858cad4 commit 1538498
Show file tree
Hide file tree
Showing 14 changed files with 1,054 additions and 208 deletions.
22 changes: 11 additions & 11 deletions server/db/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,30 @@ func Init(ctx context.Context, tracer *trace.TracerProvider) (*bun.DB, *sql.DB,
(*models.EventToTutor)(nil),
(*models.TutorToEvent)(nil),
(*models.StudentToEvent)(nil),
(*models.RoomToEvent)(nil),
}

for _, relation := range relations {
db.RegisterModel(relation)
}

if err := createTables(ctx, db, relations); err != nil {
return nil, nil, err
}
(*models.RoomToEvent)(nil)}

tables := []interface{}{
(*models.Topic)(nil),
(*models.Event)(nil),
(*models.User)(nil),
(*models.Tutor)(nil),
(*models.Student)(nil),
(*models.Building)(nil),
(*models.Room)(nil),
(*models.Answer)(nil),
(*models.Answer)(nil)}

for _, relation := range relations {
db.RegisterModel(relation)
}

if err := createTables(ctx, db, tables); err != nil {
return nil, nil, err
}

if err := createTables(ctx, db, relations); err != nil {
return nil, nil, err
}

return db, sqldb, nil
}

Expand Down
1 change: 0 additions & 1 deletion server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ require (
github.com/uptrace/bun/extra/bunotel v1.2.1
github.com/vektah/gqlparser/v2 v2.5.16
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0
go.opentelemetry.io/otel v1.28.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0
go.opentelemetry.io/otel/sdk v1.28.0
Expand Down
2 changes: 0 additions & 2 deletions server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@ go.opentelemetry.io/contrib v1.27.0 h1:0dNzbHzLqdAT2qoHr9tooz2Iqh+QPyaW01UxNWPZm
go.opentelemetry.io/contrib v1.27.0/go.mod h1:Tmhw9grdWtmXy6DxZNpIAudzYJqLeEM2P6QTZQSRwU8=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg=
go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo=
go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY=
Expand Down
Loading

0 comments on commit 1538498

Please sign in to comment.