cahnge migration on goose

This commit is contained in:
valitovgaziz
2024-08-06 11:18:13 +05:00
parent 25126c176f
commit 65eefa9855
6 changed files with 21 additions and 9 deletions
+3
View File
@@ -0,0 +1,3 @@
{
"gigacode.inlineColor": "green"
}
-2
View File
@@ -8,6 +8,4 @@ RUN go mod tidy
RUN go build -o bin/api.exe cmd/main.go RUN go build -o bin/api.exe cmd/main.go
RUN
ENTRYPOINT [ "bin/api.exe" ] ENTRYPOINT [ "bin/api.exe" ]
@@ -1 +0,0 @@
DROP TABLE IF EXISTS users;
@@ -1,6 +0,0 @@
CREATE TABLE IF NOT EXIST users(
id UUID PRIMARY KEY,
name VARCHAR(50) NOT NULL,
password VARCHAR(50) NOT NULL,
email VARCHAR(300) UNIQUE NOT NULL
);
@@ -0,0 +1,15 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE IF NOT EXISTS users(
id UUID PRIMARY KEY NOT NULL,
name VARCHAR(50) NOT NULL,
email VARCHAR(50),
password VARCHAR(1000) NOT NULL,
phone VARCHAR(30) NOT NULL
);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE IF EXISTS users;
-- +goose StatementEnd
+3
View File
@@ -0,0 +1,3 @@
GOOSE_DRIVER=postgres
GOOSE_DBSTRING="user=postgres dbname=postgres sslmode=disable"
GOOSE_MIGRATION_DIR=/