Files
MyClub/database/migrations/20251012000001_create_clothing_table.up.sql
T
Tomáš Dvořák 12cba639b9 upload
2025-10-16 13:32:05 +02:00

21 lines
720 B
SQL

-- Create clothing table for merchandising items
CREATE TABLE IF NOT EXISTS clothing (
id SERIAL PRIMARY KEY,
title VARCHAR(255) NOT NULL,
description TEXT,
price DECIMAL(10, 2),
currency VARCHAR(10) DEFAULT '',
image_url VARCHAR(500),
url VARCHAR(500),
is_active BOOLEAN DEFAULT true,
display_order INT DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
deleted_at TIMESTAMP
);
-- Create index for active items and ordering
CREATE INDEX idx_clothing_active ON clothing(is_active);
CREATE INDEX idx_clothing_display_order ON clothing(display_order);
CREATE INDEX idx_clothing_created_at ON clothing(created_at);