yjp 10 månader sedan
förälder
incheckning
d2208e4885
1 ändrade filer med 4 tillägg och 2 borttagningar
  1. 4 2
      operations/operations.go

+ 4 - 2
operations/operations.go

@@ -127,8 +127,10 @@ func (op *Operations) AutoMigrate(tables ...Table) error {
 }
 
 func (op *Operations) Table(name string, args ...any) DBOperations {
-	op.processDB = op.initDB.Table(name, args...)
-	return op
+	return &Operations{
+		initDB:    op.initDB,
+		processDB: op.initDB.Table(name, args...),
+	}
 }
 
 func (op *Operations) Raw(sql string, values ...any) DBOperations {