-- Address tags table

CREATE TABLE IF NOT EXISTS address_tags (
    id BIGSERIAL,
    chain_id INTEGER NOT NULL,
    address VARCHAR(42) NOT NULL,
    tag VARCHAR(255) NOT NULL,
    source VARCHAR(50),
    created_at TIMESTAMP DEFAULT NOW(),
    PRIMARY KEY (id),
    UNIQUE (chain_id, address, tag)
);

CREATE INDEX idx_address_tags_chain_address ON address_tags(chain_id, address);
CREATE INDEX idx_address_tags_tag ON address_tags(tag);

