Indexium/indexium-backend/migrations/20260908000001_collections.sql

10 lines
375 B
SQL

CREATE TABLE IF NOT EXISTS collections (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
slug VARCHAR(64) UNIQUE NOT NULL,
title VARCHAR(128) NOT NULL,
description TEXT,
mods JSONB NOT NULL DEFAULT '[]'::jsonb,
author_id BIGINT,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_collections_slug ON collections(slug);