Skip to content

Instantly share code, notes, and snippets.

@shahidhk
Last active August 3, 2021 22:48
Show Gist options
  • Save shahidhk/d4a6231749fbeeede2c916c068d4d1e2 to your computer and use it in GitHub Desktop.
Save shahidhk/d4a6231749fbeeede2c916c068d4d1e2 to your computer and use it in GitHub Desktop.
An indicative product table with JSONB column for specs
CREATE TABLE product (
uuid UUID NOT NULL DEFAULT gen_random_uuid(),
name TEXT NOT NULL,
category TEXT NOT NULL,
description TEXT NOT NULL,
price NUMERIC NOT NULL,
spec JSONB NOT NULL,
PRIMARY KEY (uuid)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment