goose migration established
This commit is contained in:
+4
-6
@@ -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)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user