6.9.0: Задачи-закупки
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m20s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
poignatov
2026-03-10 22:37:03 +03:00
parent 786a03bf86
commit 636f53eb04
12 changed files with 1363 additions and 21 deletions

View File

@@ -0,0 +1,3 @@
ALTER TABLE tasks DROP COLUMN IF EXISTS purchase_config_id;
DROP TABLE IF EXISTS purchase_config_boards;
DROP TABLE IF EXISTS purchase_configs;

View File

@@ -0,0 +1,24 @@
-- Purchase task configurations
CREATE TABLE purchase_configs (
id SERIAL PRIMARY KEY,
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_purchase_configs_user_id ON purchase_configs(user_id);
-- Purchase config board/group associations
CREATE TABLE purchase_config_boards (
id SERIAL PRIMARY KEY,
purchase_config_id INTEGER NOT NULL REFERENCES purchase_configs(id) ON DELETE CASCADE,
board_id INTEGER NOT NULL REFERENCES shopping_boards(id) ON DELETE CASCADE,
group_name VARCHAR(255),
UNIQUE (purchase_config_id, board_id, group_name)
);
CREATE INDEX idx_purchase_config_boards_config_id ON purchase_config_boards(purchase_config_id);
CREATE INDEX idx_purchase_config_boards_board_id ON purchase_config_boards(board_id);
-- Add purchase_config_id to tasks
ALTER TABLE tasks ADD COLUMN purchase_config_id INTEGER REFERENCES purchase_configs(id) ON DELETE SET NULL;
CREATE INDEX idx_tasks_purchase_config_id ON tasks(purchase_config_id);