6.9.0: Задачи-закупки
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m20s
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:
24
play-life-backend/migrations/000029_purchase_tasks.up.sql
Normal file
24
play-life-backend/migrations/000029_purchase_tasks.up.sql
Normal 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);
|
||||
Reference in New Issue
Block a user