one more microservice migrator goose
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user