File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,6 +134,14 @@ func (r JobDBHandler) DropTables() error {
134134 return helper .NewError ("job_archive table" , err )
135135 }
136136
137+ for _ , functionName := range loadSql .JobFunctions {
138+ dropFunctionQuery := fmt .Sprintf (`DROP FUNCTION IF EXISTS %s;` , functionName )
139+ _ , err = r .db .Instance .ExecContext (ctx , dropFunctionQuery )
140+ if err != nil {
141+ return helper .NewError ("drop function " + functionName , err )
142+ }
143+ }
144+
137145 r .db .Logger .Info ("Dropped table job" )
138146
139147 return nil
Original file line number Diff line number Diff line change @@ -96,6 +96,14 @@ func (r MasterDBHandler) DropTable() error {
9696 return helper .NewError ("drop" , err )
9797 }
9898
99+ for _ , functionName := range loadSql .MasterFunctions {
100+ dropFunctionQuery := fmt .Sprintf (`DROP FUNCTION IF EXISTS %s;` , functionName )
101+ _ , err = r .db .Instance .ExecContext (ctx , dropFunctionQuery )
102+ if err != nil {
103+ return helper .NewError ("drop function " + functionName , err )
104+ }
105+ }
106+
99107 r .db .Logger .Info ("Dropped table master" )
100108
101109 return nil
Original file line number Diff line number Diff line change @@ -110,6 +110,14 @@ func (r WorkerDBHandler) DropTable() error {
110110 return helper .NewError ("worker table" , err )
111111 }
112112
113+ for _ , functionName := range loadSql .WorkerFunctions {
114+ dropFunctionQuery := fmt .Sprintf (`DROP FUNCTION IF EXISTS %s;` , functionName )
115+ _ , err = r .db .Instance .ExecContext (ctx , dropFunctionQuery )
116+ if err != nil {
117+ return helper .NewError ("drop function " + functionName , err )
118+ }
119+ }
120+
113121 r .db .Logger .Info ("Dropped table worker" )
114122
115123 return nil
You can’t perform that action at this time.
0 commit comments