From a7caf6c4224c4775eafde69ede841b79ddb0b0cc Mon Sep 17 00:00:00 2001 From: Fedorov Vladimir Date: Mon, 14 Aug 2023 03:40:36 +0700 Subject: [PATCH] add migration --- migrations/{init.sql => 20230814031823_init.sql} | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) rename migrations/{init.sql => 20230814031823_init.sql} (53%) diff --git a/migrations/init.sql b/migrations/20230814031823_init.sql similarity index 53% rename from migrations/init.sql rename to migrations/20230814031823_init.sql index e7c4f4d..2f067bc 100644 --- a/migrations/init.sql +++ b/migrations/20230814031823_init.sql @@ -1,7 +1,14 @@ -DROP TABLE IF EXISTS users; +-- +goose Up +-- +goose StatementBegin CREATE TABLE users ( id SERIAL PRIMARY KEY, chat_id TEXT NOT NULL, user_id TEXT NOT NULL, CONSTRAINT unique__chat_id__user_id UNIQUE (chat_id, user_id) -); \ No newline at end of file +); +-- +goose StatementEnd + +-- +goose Down +-- +goose StatementBegin +DROP TABLE users; +-- +goose StatementEnd