Add full shop application: Go backend, PostgreSQL, Docker, Caddy and admin panel.

This commit is contained in:
shop
2026-06-25 16:39:33 +03:00
parent a150e4f8c6
commit ee5688f722
24 changed files with 1797 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
package database
import (
"context"
"github.com/jackc/pgx/v5/pgxpool"
)
func Migrate(ctx context.Context, pool *pgxpool.Pool) error {
_, err := pool.Exec(ctx, `
CREATE TABLE IF NOT EXISTS admins (
id SERIAL PRIMARY KEY,
email VARCHAR(255) UNIQUE NOT NULL,
password_hash VARCHAR(255) NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
`)
return err
}