one more microservice migrator goose

This commit is contained in:
valitovgaziz
2024-08-08 14:53:20 +05:00
parent acc9bb5906
commit 260a01b27c
6 changed files with 37 additions and 23 deletions
+10
View File
@@ -0,0 +1,10 @@
FROM golang:1.22.5
RUN go get github.com/pressly/goose/cmd/goose
WORKDIR /app
COPY migrations/* app/migrations/
CMD [ "goose", "up", "-dir=/app/migrations" ]
@@ -0,0 +1,15 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE users(
id UUID NOT NULL PRIMARY KEY,
name VARCHAR(50) NOT NULL,
email VARCHAR(50) NOT NULL UNIQUE INDEX,
password VARCHAR(500) NOT NULL,
phone VARCHAR(50)
);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE users;
-- +goose StatementEnd