-- DROP TABLE IF EXISTS "newsletter_post";

CREATE TABLE IF NOT EXISTS "newsletter_post" (
  "newsletter_post_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY
  "name" varchar(191) NOT NULL,
  "content" text NOT NULL,
  "status"  smallint NOT NULL DEFAULT 1, -- archived = 0, active = 1
  "sent" INT NOT NULL DEFAULT 0,
  "open" INT NOT NULL DEFAULT 0,
  "click" INT NOT NULL DEFAULT 0,
  "created_at" timestamp(0) NOT NULL DEFAULT now(),
  "updated_at" timestamp(0) NOT NULL DEFAULT now()
);

