-- animal 테이블 생성
CREATE TABLE tb_animal
(
	uid           BIGSERIAL PRIMARY KEY,
	uuid          UUID         NOT NULL UNIQUE,
	category      VARCHAR(50),
	species       VARCHAR(100),
	name          VARCHAR(200) NOT NULL,
	is_deleted    BOOLEAN      NOT NULL DEFAULT FALSE,
	created_date  TIMESTAMPTZ  NOT NULL,
	modified_date TIMESTAMPTZ  NOT NULL
);

-- 인덱스 생성
CREATE INDEX idx_animal_uuid ON tb_animal (uuid);
CREATE INDEX idx_animal_category ON tb_animal (category);
CREATE INDEX idx_animal_species ON tb_animal (species);
CREATE INDEX idx_animal_name ON tb_animal (name);
CREATE INDEX idx_animal_is_deleted ON tb_animal (is_deleted);

-- 주석 추가
COMMENT ON TABLE tb_animal IS '동물원 동물 정보';
COMMENT ON COLUMN tb_animal.uid IS '고유 식별자 (PK)';
COMMENT ON COLUMN tb_animal.uuid IS 'UUID (Unique)';
COMMENT ON COLUMN tb_animal.category IS '구분 (MAMMALS, BIRDS, FISH,AMPHIBIANS,REPTILES,INSECTS, INVERTEBRATES )';
COMMENT ON COLUMN tb_animal.species IS '동물 종';
COMMENT ON COLUMN tb_animal.name IS '동물 이름';
COMMENT ON COLUMN tb_animal.is_deleted IS '삭제 여부';
COMMENT ON COLUMN tb_animal.created_date IS '생성일시';
COMMENT ON COLUMN tb_animal.modified_date IS '수정일시';
