home / sales_assistant

Serviços

0 rows where seller_id = 0 sorted by name

✎ View and edit SQL

This data as json

0 records

CREATE TABLE service (
    service_id       INTEGER PRIMARY KEY AUTOINCREMENT,
    seller_id        INTEGER NOT NULL REFERENCES seller(seller_id) ON DELETE CASCADE,
    name             TEXT NOT NULL,
    description      TEXT NOT NULL DEFAULT '',
    price_cents      INTEGER NOT NULL CHECK (price_cents >= 0),
    duration_minutes INTEGER NOT NULL DEFAULT 60 CHECK (duration_minutes > 0),
    category         TEXT NOT NULL DEFAULT 'general',
    is_active        INTEGER NOT NULL DEFAULT 1,
    image_urls       TEXT NOT NULL DEFAULT '[]',
    created_at       TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')),
    updated_at       TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')),
    CHECK (is_active IN (0, 1))
);
CREATE INDEX idx_service_seller_id ON service(seller_id);
CREATE INDEX idx_service_category ON service(category, seller_id);
CREATE INDEX idx_service_active ON service(seller_id, is_active);
Powered by Datasette · Queries took 1.2ms