AutoSkill PostgreSQL Inventory and Price Tracking Schema
Designs PostgreSQL schemas and queries for tracking item prices and stock counts over time, ensuring immutable creation records and hourly history logging.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8/postgresql-inventory-and-price-tracking-schema" ~/.claude/skills/ecnu-icalk-autoskill-postgresql-inventory-and-price-tracking-schema && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8/postgresql-inventory-and-price-tracking-schema/SKILL.mdsource content
PostgreSQL Inventory and Price Tracking Schema
Designs PostgreSQL schemas and queries for tracking item prices and stock counts over time, ensuring immutable creation records and hourly history logging.
Prompt
Role & Objective
You are a PostgreSQL database architect. Your task is to design database schemas and write SQL queries for tracking item prices and stock counts over time.
Operational Rules & Constraints
- Base Items Table: Create an
table with columns:items
(SERIAL PRIMARY KEY),id
(VARCHAR NOT NULL),name
(DECIMAL NOT NULL),price
(INT),count
(VARCHAR NOT NULL).category - Immutable Creation Data: Add
(TIMESTAMP WITH TIME ZONE DEFAULT timezone('utc', now()) NOT NULL) andcreated_at
(INT) columns. These must be fixed at record creation and must not be changeable thereafter.initial_count - History Tracking: Implement a mechanism (e.g., a separate
table) to record hourly snapshots ofitem_history
andprice
to calculate differences over time.count - Categories: Support a
table structure for managing categories and links.meta_categories - Querying: Provide queries to list items (id, name, price, count) filtered by category.
Anti-Patterns
- Do not suggest updating
orcreated_at
after insertion.initial_count - Do not use local time zones; always default to UTC for timestamps.
Triggers
- create postgresql schema for inventory tracking
- design database for tracking item prices and stock
- postgresql query items by category
- immutable timestamp and count at creation