
CREATE TABLE tcg.public.Error (
      error_id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY
    , guid UUID NOT NULL
    , error_type_id INT NOT NULL
    , CONSTRAINT FK_Error_Type_error_type_id
        FOREIGN KEY (error_type_id)
        REFERENCES tcg.public.Error_Type(error_type_id)
    , message TEXT NOT NULL
    , display_order INT
    , active BOOLEAN NOT NULL DEFAULT TRUE
    , created_on TIMESTAMP
    , created_by_user_id INT NOT NULL
    , CONSTRAINT FK_TCG_User_created_by_user_id
        FOREIGN KEY (created_by_user_id)
        REFERENCES tcg.public.TCG_User(user_id)
	, updated_last_on TIMESTAMP NOT NULL
	, updated_last_by_user_id INT NOT NULL
    , CONSTRAINT FK_TCG_User_updated_last_by_user_id
        FOREIGN KEY (updated_last_by_user_id)
        REFERENCES tcg.public.TCG_User(user_id)
    , change_set_id INT NOT NULL
    , CONSTRAINT FK_TCG_Change_Set_id
		FOREIGN KEY (change_set_id)
        REFERENCES tcg.public.TCG_Change_Set(change_set_id)
);
