--
--  写真
--      t_image
--

-- DROP TABLE t_image;

CREATE TABLE t_image
(
    typediv         integer NOT NULL,               -- PriKey
    generalcd       integer NOT NULL,               -- PriKey
    generalsubcd    integer,                        -- PriKey
    imgsizecd       character varying(1) NOT NULL,  -- PriKey
    sellercd        integer,                        -- PriKey, ForKey
    stockcd         integer,                        -- PriKey

    delflg      boolean,
    adddate     timestamp without time zone,
    upddate     timestamp without time zone,
    updusrnm    character varying(60),
    updpcnm     character varying(60),
    updcnt      integer,

    PRIMARY KEY(typediv, generalcd, generalsubcd, imgsizecd, sellercd, stockcd)
);


-- Trigger: trigger_master_stamp on t_image

-- DROP TRIGGER trigger_master_stamp ON t_image;

-- トリガー
CREATE TRIGGER trigger_master_stamp
  BEFORE INSERT OR UPDATE
  ON t_image
  FOR EACH ROW
  EXECUTE PROCEDURE g_master_stamp();
