DROP TABLE IF EXISTS field_group;

-- DROP SEQUENCE IF EXISTS field_group_field_group_id_seq;
-- CREATE SEQUENCE field_group_field_group_id_seq;


CREATE TABLE field_group (
  "field_group_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY,
  "type" varchar(128) NOT NULL DEFAULT 'post', -- post, product, user, taxonomy item
  "subtype" varchar(128) NOT NULL DEFAULT 'page', -- post, page, product
  "conditions" text, -- json conditions
  "status" smallint NOT NULL,
  "sort_order" int NOT NULL DEFAULT 0
  -- PRIMARY KEY("field_group_id")
);

-- SELECT setval('field_group_field_group_id_seq', 0, true); -- last inserted id by sample data
