Artist

class django_musicbrainz_connector.models.Artist(*args, **kwargs)[source]

PostgreSQL Definition

The artist table is defined in the MusicBrainz Server as:

CREATE TABLE artist ( -- replicate (verbose)
    id                  SERIAL,
    gid                 UUID NOT NULL,
    name                VARCHAR NOT NULL,
    sort_name           VARCHAR NOT NULL,
    begin_date_year     SMALLINT,
    begin_date_month    SMALLINT,
    begin_date_day      SMALLINT,
    end_date_year       SMALLINT,
    end_date_month      SMALLINT,
    end_date_day        SMALLINT,
    type                INTEGER, -- references artist_type.id
    area                INTEGER, -- references area.id
    gender              INTEGER, -- references gender.id
    comment             VARCHAR(255) NOT NULL DEFAULT '',
    edits_pending       INTEGER NOT NULL DEFAULT 0 CHECK (edits_pending >= 0),
    last_updated        TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
    ended               BOOLEAN NOT NULL DEFAULT FALSE
    CONSTRAINT artist_ended_check CHECK (
        (
        -- If any end date fields are not null, then ended must be true
        (end_date_year IS NOT NULL OR
        end_date_month IS NOT NULL OR
        end_date_day IS NOT NULL) AND
        ended = TRUE
        ) OR (
        -- Otherwise, all end date fields must be null
        (end_date_year IS NULL AND
        end_date_month IS NULL AND
        end_date_day IS NULL)
        )
    ),
    begin_area          INTEGER, -- references area.id
    end_area            INTEGER -- references area.id
);