Files
play-life/play-life-backend/migrations/000028_shopping_item_history.up.sql
poignatov 3cac8d0452
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m20s
6.8.0: История покупок товаров
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 17:05:59 +03:00

11 lines
416 B
SQL

CREATE TABLE shopping_item_history (
id SERIAL PRIMARY KEY,
item_id INTEGER NOT NULL REFERENCES shopping_items(id) ON DELETE CASCADE,
user_id INTEGER NOT NULL REFERENCES users(id),
name VARCHAR(255) NOT NULL,
volume NUMERIC(10,4) NOT NULL DEFAULT 1,
completed_at TIMESTAMP NOT NULL DEFAULT NOW()
);
CREATE INDEX idx_shopping_item_history_item_id ON shopping_item_history(item_id);