DROP TABLE IF EXISTS vendor;

-- DROP SEQUENCE IF EXISTS vendor_vendor_id_seq;
-- CREATE SEQUENCE vendor_vendor_id_seq;


CREATE TABLE vendor (
  "vendor_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY
  "admin_id" int check ("admin_id" >= 0) NOT NULL DEFAULT 0,
  "name" varchar(191) NOT NULL DEFAULT '',
  "slug" varchar(191) NOT NULL DEFAULT '',
  "image" varchar(191) NOT NULL DEFAULT '',
  "sort_order" int NOT NULL DEFAULT 0
  -- PRIMARY KEY("vendor_id")
);

SELECT setval('vendor_vendor_id_seq', 6, true); -- last inserted id by sample data