summaryrefslogtreecommitdiff
path: root/vendor/github.com/uptrace/bun/schema/relation.go
diff options
context:
space:
mode:
authorLibravatar Terin Stock <terinjokes@gmail.com>2025-03-09 17:47:56 +0100
committerLibravatar Terin Stock <terinjokes@gmail.com>2025-03-10 01:59:49 +0100
commit3ac1ee16f377d31a0fb80c8dae28b6239ac4229e (patch)
treef61faa581feaaeaba2542b9f2b8234a590684413 /vendor/github.com/uptrace/bun/schema/relation.go
parent[chore] update URLs to forked source (diff)
downloadgotosocial-3ac1ee16f377d31a0fb80c8dae28b6239ac4229e.tar.xz
[chore] remove vendor
Diffstat (limited to 'vendor/github.com/uptrace/bun/schema/relation.go')
-rw-r--r--vendor/github.com/uptrace/bun/schema/relation.go45
1 files changed, 0 insertions, 45 deletions
diff --git a/vendor/github.com/uptrace/bun/schema/relation.go b/vendor/github.com/uptrace/bun/schema/relation.go
deleted file mode 100644
index f653cd7a3..000000000
--- a/vendor/github.com/uptrace/bun/schema/relation.go
+++ /dev/null
@@ -1,45 +0,0 @@
-package schema
-
-import (
- "fmt"
-)
-
-const (
- InvalidRelation = iota
- HasOneRelation
- BelongsToRelation
- HasManyRelation
- ManyToManyRelation
-)
-
-type Relation struct {
- // Base and Join can be explained with this query:
- //
- // SELECT * FROM base_table JOIN join_table
-
- Type int
- Field *Field
- JoinTable *Table
- BasePKs []*Field
- JoinPKs []*Field
- OnUpdate string
- OnDelete string
- Condition []string
-
- PolymorphicField *Field
- PolymorphicValue string
-
- M2MTable *Table
- M2MBasePKs []*Field
- M2MJoinPKs []*Field
-}
-
-// References returns true if the table to which the Relation belongs needs to declare a foreign key constraint to create the relation.
-// For other relations, the constraint is created in either the referencing table (1:N, 'has-many' relations) or a mapping table (N:N, 'm2m' relations).
-func (r *Relation) References() bool {
- return r.Type == HasOneRelation || r.Type == BelongsToRelation
-}
-
-func (r *Relation) String() string {
- return fmt.Sprintf("relation=%s", r.Field.GoName)
-}