@@ -211,7 +211,7 @@ func fillTablesWithData(ctx context.Context, db *sql.DB) (err error) {
211211
212212func prepareSchema (ctx context.Context , db * sql.DB ) (err error ) {
213213 err = retry .Do (ctx , db , func (ctx context.Context , cc * sql.Conn ) error {
214- err = dropTableIfNotExists (ctx , cc , "series" )
214+ err = dropTableIfExists (ctx , cc , "series" )
215215 if err != nil {
216216 _ , _ = fmt .Fprintf (os .Stdout , "warn: drop series table failed: %v\n " , err )
217217 }
@@ -240,7 +240,7 @@ func prepareSchema(ctx context.Context, db *sql.DB) (err error) {
240240 return fmt .Errorf ("create table failed: %w" , err )
241241 }
242242 err = retry .Do (ctx , db , func (ctx context.Context , cc * sql.Conn ) error {
243- err = dropTableIfNotExists (ctx , cc , "seasons" )
243+ err = dropTableIfExists (ctx , cc , "seasons" )
244244 if err != nil {
245245 _ , _ = fmt .Fprintf (os .Stdout , "warn: drop seasons table failed: %v\n " , err )
246246 }
@@ -271,7 +271,7 @@ func prepareSchema(ctx context.Context, db *sql.DB) (err error) {
271271 return fmt .Errorf ("create table failed: %w" , err )
272272 }
273273 err = retry .Do (ctx , db , func (ctx context.Context , cc * sql.Conn ) error {
274- err = dropTableIfNotExists (ctx , cc , "episodes" )
274+ err = dropTableIfExists (ctx , cc , "episodes" )
275275 if err != nil {
276276 _ , _ = fmt .Fprintf (os .Stdout , "warn: drop episodes table failed: %v\n " , err )
277277 }
@@ -306,7 +306,7 @@ func prepareSchema(ctx context.Context, db *sql.DB) (err error) {
306306 return nil
307307}
308308
309- func dropTableIfNotExists (ctx context.Context , cc * sql.Conn , tableName string ) error {
309+ func dropTableIfExists (ctx context.Context , cc * sql.Conn , tableName string ) error {
310310 driver , err := ydb .Unwrap (cc )
311311 if err != nil {
312312 return fmt .Errorf ("driver unwrap failed: %w" , err )
0 commit comments