Spaces:
Paused
Paused
Download database/migrations/002-create-widgets-table.sql from Kraft102/widgettdc-api: direct link, hf CLI and curl.
- Browser
- Download file 595 Bytes
-
https://huggingface.co/spaces/Kraft102/widgettdc-api/resolve/main/database/migrations/002-create-widgets-table.sql
- Command line
-
hf download hf://spaces/Kraft102/widgettdc-api/database/migrations/002-create-widgets-table.sql
-
curl -L -o 002-create-widgets-table.sql https://huggingface.co/spaces/Kraft102/widgettdc-api/resolve/main/database/migrations/002-create-widgets-table.sql
595 Bytes
| -- Migration: Create widgets table | |
| CREATE TABLE IF NOT EXISTS widgets ( | |
| id UUID PRIMARY KEY DEFAULT gen_random_uuid(), | |
| name VARCHAR(100) NOT NULL, | |
| description TEXT, | |
| version VARCHAR(20) NOT NULL, | |
| price DECIMAL(10, 2) NOT NULL, | |
| stock_quantity INTEGER DEFAULT 0, | |
| owner_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE, | |
| created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, | |
| updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP | |
| ); | |
| CREATE INDEX idx_widgets_name ON widgets(name); | |
| CREATE INDEX idx_widgets_owner ON widgets(owner_id); | |
| CREATE INDEX idx_widgets_version ON widgets(version); | |