diff --git a/migrations/20241109180651_add_user.sql b/migrations/20241109180651_add_user.sql index 81b8407..a590932 100644 --- a/migrations/20241109180651_add_user.sql +++ b/migrations/20241109180651_add_user.sql @@ -1,6 +1,6 @@ -- +goose Up -- +goose StatementBegin -CREATE TABLE IF NOT EXISTS "users" ( +CREATE TABLE IF NOT EXISTS users ( id SERIAL PRIMARY KEY, chat_id TEXT NOT NULL ); @@ -8,5 +8,5 @@ CREATE TABLE IF NOT EXISTS "users" ( -- +goose Down -- +goose StatementBegin -DROP TABLE IF EXISTS "users"; +DROP TABLE IF EXISTS users; -- +goose StatementEnd diff --git a/migrations/20241118122922_add_coregories_table.sql b/migrations/20241118122922_add_coregories_table.sql index 332b2e3..e44dd3a 100644 --- a/migrations/20241118122922_add_coregories_table.sql +++ b/migrations/20241118122922_add_coregories_table.sql @@ -3,11 +3,10 @@ CREATE TABLE IF NOT EXISTS categories ( id SERIAL PRIMARY KEY, name TEXT NOT NULL, - user_id INT REFERENCES "users"(id), + user_id INT REFERENCES users(id), favorite BOOLEAN DEFAULT FALSE, - "limit" INT DEFAULT 0 + monthly_limit INT DEFAULT 0 ); -comment on column categories.limit is 'Лимит трат в месяц в копейках'; -- +goose StatementEnd -- +goose Down