Skip to content

Instantly share code, notes, and snippets.

@alyrlee
Created June 27, 2020 22:14
Show Gist options
  • Save alyrlee/5e3f4d4b2076040e52c39b53221f502d to your computer and use it in GitHub Desktop.
Save alyrlee/5e3f4d4b2076040e52c39b53221f502d to your computer and use it in GitHub Desktop.
create.shopping-list.sql
DROP TYPE IF EXISTS grocery;
CREATE TYPE grocery AS ENUM (
'Main',
'Snack',
'Lunch',
'Breakfast'
);
CREATE TABLE IF NOT EXISTS amazong_products (
id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
name TEXT NOT NULL,
price decimal(12,2) NOT NULL,
date_added TIMESTAMP DEFAULT now() NOT NULL,
checked BOOLEAN DEFAULT FALSE NOT NULL,
category grocery NOT NULL
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment