initial commit

This commit is contained in:
Giovanni Rezcjikov
2026-03-08 14:54:29 +03:00
commit f4e4fb21e3
75 changed files with 7407 additions and 0 deletions
@@ -0,0 +1,23 @@
package db
import (
"context"
"fmt"
"os"
"github.com/jackc/pgx/v5/pgxpool"
)
func RunMigrations(migrationFilePath string, pool *pgxpool.Pool) error {
sql, err := os.ReadFile(migrationFilePath)
if err != nil {
return fmt.Errorf("failed to execute migrations: %w", err)
}
_, err = pool.Exec(context.Background(), string(sql))
if err != nil {
return fmt.Errorf("failed to execute migrations: %w", err)
}
return nil
}