--! Previous: sha1:8243b031500fde9c022d6aada10a429496dc264d
--! Hash: sha1:8102b0362d2ae5b73ed1d56214f7fffa445c469e
--! Message: Unit table

--- Table of definitions of units that can be summoned.
CREATE TABLE IF NOT EXISTS Unit
(
    --- The internal ID associated with this unit.
    id           SERIAL      NOT NULL PRIMARY KEY,
    --- The name of this unit.
    name         VARCHAR(50) NOT NULL,
    --- The subtitle of this unit.
    subtitle     VARCHAR(50) NOT NULL,
    --- The description of this unit.
    description  TEXT        NOT NULL,
    --- The tier of this unit.
    tierId       VARCHAR(8)  NOT NULL REFERENCES UnitTier (id) ON DELETE RESTRICT ON UPDATE CASCADE,
    --- The unit's base health when summoned for the first time.
    baseHealth   INT         NOT NULL CHECK ( baseHealth > 0 ),
    --- The unit's base strength when summoned for the first time.
    baseStrength INT         NOT NULL CHECK ( baseStrength > 0 ),
    --- The combination of Name and Subtitle is unique among units, allowing for multiple versions of a unit.
    UNIQUE (name, subtitle)
)
