CREATE TABLE units (
    id serial4 NOT NULL,
    name VARCHAR(100) NOT NULL,
    symbol VARCHAR(10) NOT NULL,

    created_by INT,
    updated_by INT,

    created_at TIMESTAMP DEFAULT now(),
    updated_at TIMESTAMP DEFAULT now(),
    deleted_at TIMESTAMP,

    CONSTRAINT units_pkey PRIMARY KEY (id)
);
CREATE UNIQUE INDEX units_name_unique_not_deleted ON units(name) WHERE deleted_at IS NULL;
CREATE UNIQUE INDEX units_symbol_unique_not_deleted ON units(symbol) WHERE deleted_at IS NULL;
