goose migration established

This commit is contained in:
valitovgaziz
2024-08-11 17:40:19 +05:00
parent f9a7615801
commit 32daac3a49
5 changed files with 43 additions and 26 deletions
+4 -6
View File
@@ -1,11 +1,9 @@
FROM golang:1.22.5
FROM golang:latest
WORKDIR /app
COPY migrations/* app/migrations/
COPY . .
COPY go.mod app/
RUN go mod tidy
RUN go install github.com/pressly/goose/v3/cmd/goose@latest
CMD ["goose", "-dir=/app/migrations", "user=${DB_USER}", "dbname=${DB_NAME}", "sslmode=${SSLmode}" "up"]
RUN go install github.com/pressly/goose/v3/cmd/goose@latest
@@ -1,9 +1,10 @@
-- Active: 1723171055346@@127.0.0.1@5432@postgres@public
-- +goose Up
-- +goose StatementBegin
CREATE TABLE IF NOT EXISTS users(
id UUID NOT NULL PRIMARY KEY,
name VARCHAR(50) NOT NULL,
email VARCHAR(50) NOT NULL UNIQUE INDEX,
email VARCHAR(50) NOT NULL,
password VARCHAR(500) NOT NULL,
phone VARCHAR(50)
);