-- Schema: bird__card_games
CREATE SCHEMA IF NOT EXISTS "bird__card_games";

-- Table: cards
CREATE TABLE "bird__card_games"."cards" (
    "id" BIGINT NOT NULL,
    "artist" TEXT,
    "asciiName" TEXT,
    "availability" TEXT,
    "borderColor" TEXT,
    "cardKingdomFoilId" TEXT,
    "cardKingdomId" TEXT,
    "colorIdentity" TEXT,
    "colorIndicator" TEXT,
    "colors" TEXT,
    "convertedManaCost" DOUBLE PRECISION,
    "duelDeck" TEXT,
    "edhrecRank" BIGINT,
    "faceConvertedManaCost" DOUBLE PRECISION,
    "faceName" TEXT,
    "flavorName" TEXT,
    "flavorText" TEXT,
    "frameEffects" TEXT,
    "frameVersion" TEXT,
    "hand" TEXT,
    "hasAlternativeDeckLimit" BIGINT NOT NULL DEFAULT 0,
    "hasContentWarning" BIGINT NOT NULL DEFAULT 0,
    "hasFoil" BIGINT NOT NULL DEFAULT 0,
    "hasNonFoil" BIGINT NOT NULL DEFAULT 0,
    "isAlternative" BIGINT NOT NULL DEFAULT 0,
    "isFullArt" BIGINT NOT NULL DEFAULT 0,
    "isOnlineOnly" BIGINT NOT NULL DEFAULT 0,
    "isOversized" BIGINT NOT NULL DEFAULT 0,
    "isPromo" BIGINT NOT NULL DEFAULT 0,
    "isReprint" BIGINT NOT NULL DEFAULT 0,
    "isReserved" BIGINT NOT NULL DEFAULT 0,
    "isStarter" BIGINT NOT NULL DEFAULT 0,
    "isStorySpotlight" BIGINT NOT NULL DEFAULT 0,
    "isTextless" BIGINT NOT NULL DEFAULT 0,
    "isTimeshifted" BIGINT NOT NULL DEFAULT 0,
    "keywords" TEXT,
    "layout" TEXT,
    "leadershipSkills" TEXT,
    "life" TEXT,
    "loyalty" TEXT,
    "manaCost" TEXT,
    "mcmId" TEXT,
    "mcmMetaId" TEXT,
    "mtgArenaId" TEXT,
    "mtgjsonV4Id" TEXT,
    "mtgoFoilId" TEXT,
    "mtgoId" TEXT,
    "multiverseId" TEXT,
    "name" TEXT,
    "number" TEXT,
    "originalReleaseDate" TEXT,
    "originalText" TEXT,
    "originalType" TEXT,
    "otherFaceIds" TEXT,
    "power" TEXT,
    "printings" TEXT,
    "promoTypes" TEXT,
    "purchaseUrls" TEXT,
    "rarity" TEXT,
    "scryfallId" TEXT,
    "scryfallIllustrationId" TEXT,
    "scryfallOracleId" TEXT,
    "setCode" TEXT,
    "side" TEXT,
    "subtypes" TEXT,
    "supertypes" TEXT,
    "tcgplayerProductId" TEXT,
    "text" TEXT,
    "toughness" TEXT,
    "type" TEXT,
    "types" TEXT,
    "uuid" TEXT NOT NULL,
    "variations" TEXT,
    "watermark" TEXT,
    CONSTRAINT "cards_pkey" PRIMARY KEY ("id")
);

-- Table: foreign_data
CREATE TABLE "bird__card_games"."foreign_data" (
    "id" BIGINT NOT NULL,
    "flavorText" TEXT,
    "language" TEXT,
    "multiverseid" BIGINT,
    "name" TEXT,
    "text" TEXT,
    "type" TEXT,
    "uuid" TEXT,
    CONSTRAINT "foreign_data_pkey" PRIMARY KEY ("id")
);

-- Table: legalities
CREATE TABLE "bird__card_games"."legalities" (
    "id" BIGINT NOT NULL,
    "format" TEXT,
    "status" TEXT,
    "uuid" TEXT,
    CONSTRAINT "legalities_pkey" PRIMARY KEY ("id")
);

-- Table: rulings
CREATE TABLE "bird__card_games"."rulings" (
    "id" BIGINT NOT NULL,
    "date" DATE,
    "text" TEXT,
    "uuid" TEXT,
    CONSTRAINT "rulings_pkey" PRIMARY KEY ("id")
);

-- Table: set_translations
CREATE TABLE "bird__card_games"."set_translations" (
    "id" BIGINT NOT NULL,
    "language" TEXT,
    "setCode" TEXT,
    "translation" TEXT,
    CONSTRAINT "set_translations_pkey" PRIMARY KEY ("id")
);

-- Table: sets
CREATE TABLE "bird__card_games"."sets" (
    "id" BIGINT NOT NULL,
    "baseSetSize" BIGINT,
    "block" TEXT,
    "booster" TEXT,
    "code" TEXT NOT NULL,
    "isFoilOnly" BIGINT NOT NULL DEFAULT 0,
    "isForeignOnly" BIGINT NOT NULL DEFAULT 0,
    "isNonFoilOnly" BIGINT NOT NULL DEFAULT 0,
    "isOnlineOnly" BIGINT NOT NULL DEFAULT 0,
    "isPartialPreview" BIGINT NOT NULL DEFAULT 0,
    "keyruneCode" TEXT,
    "mcmId" BIGINT,
    "mcmIdExtras" BIGINT,
    "mcmName" TEXT,
    "mtgoCode" TEXT,
    "name" TEXT,
    "parentCode" TEXT,
    "releaseDate" DATE,
    "tcgplayerGroupId" BIGINT,
    "totalSetSize" BIGINT,
    "type" TEXT,
    CONSTRAINT "sets_pkey" PRIMARY KEY ("id")
);
