{
  "id": "170f1508-e247-4cd8-aedd-951ea03e6fec",
  "prevId": "00000000-0000-0000-0000-000000000000",
  "version": "7",
  "dialect": "postgresql",
  "tables": {
    "public.account": {
      "name": "account",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "account_id": {
          "name": "account_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "provider_id": {
          "name": "provider_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "access_token": {
          "name": "access_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "refresh_token": {
          "name": "refresh_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "id_token": {
          "name": "id_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "access_token_expires_at": {
          "name": "access_token_expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "refresh_token_expires_at": {
          "name": "refresh_token_expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "scope": {
          "name": "scope",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "password": {
          "name": "password",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "account_userId_idx": {
          "name": "account_userId_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "account_user_id_user_id_fk": {
          "name": "account_user_id_user_id_fk",
          "tableFrom": "account",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.session": {
      "name": "session",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "expires_at": {
          "name": "expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "token": {
          "name": "token",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "ip_address": {
          "name": "ip_address",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "user_agent": {
          "name": "user_agent",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "session_userId_idx": {
          "name": "session_userId_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "session_user_id_user_id_fk": {
          "name": "session_user_id_user_id_fk",
          "tableFrom": "session",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "session_token_unique": {
          "name": "session_token_unique",
          "nullsNotDistinct": false,
          "columns": [
            "token"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.user": {
      "name": "user",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "email_verified": {
          "name": "email_verified",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "image": {
          "name": "image",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "ruolo": {
          "name": "ruolo",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'player'"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "user_email_unique": {
          "name": "user_email_unique",
          "nullsNotDistinct": false,
          "columns": [
            "email"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.verification": {
      "name": "verification",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "identifier": {
          "name": "identifier",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "value": {
          "name": "value",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "expires_at": {
          "name": "expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "verification_identifier_idx": {
          "name": "verification_identifier_idx",
          "columns": [
            {
              "expression": "identifier",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.event": {
      "name": "event",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "slug": {
          "name": "slug",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "tipo": {
          "name": "tipo",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "season_id": {
          "name": "season_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "nome": {
          "name": "nome",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "stato": {
          "name": "stato",
          "type": "event_stato",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'bozza'"
        },
        "regolamento_versione": {
          "name": "regolamento_versione",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "format_config": {
          "name": "format_config",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_by": {
          "name": "created_by",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "event_season_id_season_id_fk": {
          "name": "event_season_id_season_id_fk",
          "tableFrom": "event",
          "tableTo": "season",
          "columnsFrom": [
            "season_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "event_created_by_user_id_fk": {
          "name": "event_created_by_user_id_fk",
          "tableFrom": "event",
          "tableTo": "user",
          "columnsFrom": [
            "created_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "event_slug_unique": {
          "name": "event_slug_unique",
          "nullsNotDistinct": false,
          "columns": [
            "slug"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.girone": {
      "name": "girone",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "phase_id": {
          "name": "phase_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "livello": {
          "name": "livello",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "nome_tematico": {
          "name": "nome_tematico",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "dimensione": {
          "name": "dimensione",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "ordine": {
          "name": "ordine",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "rank_base": {
          "name": "rank_base",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "girone_phase_idx": {
          "name": "girone_phase_idx",
          "columns": [
            {
              "expression": "phase_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "girone_phase_id_phase_id_fk": {
          "name": "girone_phase_id_phase_id_fk",
          "tableFrom": "girone",
          "tableTo": "phase",
          "columnsFrom": [
            "phase_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.phase": {
      "name": "phase",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "event_id": {
          "name": "event_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "ordine": {
          "name": "ordine",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "kind": {
          "name": "kind",
          "type": "phase_kind",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true
        },
        "nome": {
          "name": "nome",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "stato": {
          "name": "stato",
          "type": "phase_stato",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'pending'"
        },
        "config": {
          "name": "config",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "seeding_source": {
          "name": "seeding_source",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "phase_event_idx": {
          "name": "phase_event_idx",
          "columns": [
            {
              "expression": "event_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "phase_event_id_event_id_fk": {
          "name": "phase_event_id_event_id_fk",
          "tableFrom": "phase",
          "tableTo": "event",
          "columnsFrom": [
            "event_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.season": {
      "name": "season",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "identificativo": {
          "name": "identificativo",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "tipo_periodo": {
          "name": "tipo_periodo",
          "type": "tipo_periodo",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true
        },
        "anno": {
          "name": "anno",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "is_current": {
          "name": "is_current",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "started_at": {
          "name": "started_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "ended_at": {
          "name": "ended_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "season_identificativo_unique": {
          "name": "season_identificativo_unique",
          "nullsNotDistinct": false,
          "columns": [
            "identificativo"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.player": {
      "name": "player",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "nick_tdg": {
          "name": "nick_tdg",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "nome_app_tta": {
          "name": "nome_app_tta",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "attivo": {
          "name": "attivo",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "note": {
          "name": "note",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "player_user_id_user_id_fk": {
          "name": "player_user_id_user_id_fk",
          "tableFrom": "player",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "player_nick_tdg_unique": {
          "name": "player_nick_tdg_unique",
          "nullsNotDistinct": false,
          "columns": [
            "nick_tdg"
          ]
        },
        "player_nome_app_tta_unique": {
          "name": "player_nome_app_tta_unique",
          "nullsNotDistinct": false,
          "columns": [
            "nome_app_tta"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.player_alias": {
      "name": "player_alias",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "player_id": {
          "name": "player_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "alias_nick": {
          "name": "alias_nick",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "alias_nome_app": {
          "name": "alias_nome_app",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "fonte": {
          "name": "fonte",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "player_alias_player_id_player_id_fk": {
          "name": "player_alias_player_id_player_id_fk",
          "tableFrom": "player_alias",
          "tableTo": "player",
          "columnsFrom": [
            "player_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.match": {
      "name": "match",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "phase_id": {
          "name": "phase_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "girone_id": {
          "name": "girone_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "serie_index": {
          "name": "serie_index",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "n_giocatori": {
          "name": "n_giocatori",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "stato": {
          "name": "stato",
          "type": "match_stato",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'programmata'"
        },
        "link_app_cge": {
          "name": "link_app_cge",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "data_avvio_prevista": {
          "name": "data_avvio_prevista",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "data_avvio_effettiva": {
          "name": "data_avvio_effettiva",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "match_phase_idx": {
          "name": "match_phase_idx",
          "columns": [
            {
              "expression": "phase_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "match_girone_idx": {
          "name": "match_girone_idx",
          "columns": [
            {
              "expression": "girone_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "match_phase_id_phase_id_fk": {
          "name": "match_phase_id_phase_id_fk",
          "tableFrom": "match",
          "tableTo": "phase",
          "columnsFrom": [
            "phase_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "match_girone_id_girone_id_fk": {
          "name": "match_girone_id_girone_id_fk",
          "tableFrom": "match",
          "tableTo": "girone",
          "columnsFrom": [
            "girone_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.match_participant": {
      "name": "match_participant",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "match_id": {
          "name": "match_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "player_id": {
          "name": "player_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "is_bot": {
          "name": "is_bot",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "posizione": {
          "name": "posizione",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "punti_cultura": {
          "name": "punti_cultura",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "punti_torneo": {
          "name": "punti_torneo",
          "type": "double precision",
          "primaryKey": false,
          "notNull": false
        },
        "resign": {
          "name": "resign",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "mp_match_idx": {
          "name": "mp_match_idx",
          "columns": [
            {
              "expression": "match_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "match_participant_match_id_match_id_fk": {
          "name": "match_participant_match_id_match_id_fk",
          "tableFrom": "match_participant",
          "tableTo": "match",
          "columnsFrom": [
            "match_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "match_participant_player_id_player_id_fk": {
          "name": "match_participant_player_id_player_id_fk",
          "tableFrom": "match_participant",
          "tableTo": "player",
          "columnsFrom": [
            "player_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.standing": {
      "name": "standing",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "phase_id": {
          "name": "phase_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "girone_id": {
          "name": "girone_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "player_id": {
          "name": "player_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "punti_torneo": {
          "name": "punti_torneo",
          "type": "double precision",
          "primaryKey": false,
          "notNull": false
        },
        "punti_spareggio": {
          "name": "punti_spareggio",
          "type": "double precision",
          "primaryKey": false,
          "notNull": false
        },
        "posizione_finale": {
          "name": "posizione_finale",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "esito": {
          "name": "esito",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "standing_girone_idx": {
          "name": "standing_girone_idx",
          "columns": [
            {
              "expression": "girone_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "standing_phase_id_phase_id_fk": {
          "name": "standing_phase_id_phase_id_fk",
          "tableFrom": "standing",
          "tableTo": "phase",
          "columnsFrom": [
            "phase_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "standing_girone_id_girone_id_fk": {
          "name": "standing_girone_id_girone_id_fk",
          "tableFrom": "standing",
          "tableTo": "girone",
          "columnsFrom": [
            "girone_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "standing_player_id_player_id_fk": {
          "name": "standing_player_id_player_id_fk",
          "tableFrom": "standing",
          "tableTo": "player",
          "columnsFrom": [
            "player_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.ranking": {
      "name": "ranking",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "player_id": {
          "name": "player_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "season_id": {
          "name": "season_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "serie": {
          "name": "serie",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "posizione_globale": {
          "name": "posizione_globale",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "is_coda": {
          "name": "is_coda",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "note": {
          "name": "note",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "source_phase_id": {
          "name": "source_phase_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "ranking_player_idx": {
          "name": "ranking_player_idx",
          "columns": [
            {
              "expression": "player_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "ranking_season_idx": {
          "name": "ranking_season_idx",
          "columns": [
            {
              "expression": "season_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "ranking_player_id_player_id_fk": {
          "name": "ranking_player_id_player_id_fk",
          "tableFrom": "ranking",
          "tableTo": "player",
          "columnsFrom": [
            "player_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "ranking_season_id_season_id_fk": {
          "name": "ranking_season_id_season_id_fk",
          "tableFrom": "ranking",
          "tableTo": "season",
          "columnsFrom": [
            "season_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "ranking_source_phase_id_phase_id_fk": {
          "name": "ranking_source_phase_id_phase_id_fk",
          "tableFrom": "ranking",
          "tableTo": "phase",
          "columnsFrom": [
            "source_phase_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.sanction": {
      "name": "sanction",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "player_id": {
          "name": "player_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "event_id": {
          "name": "event_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "tipo": {
          "name": "tipo",
          "type": "sanction_tipo",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true
        },
        "valore": {
          "name": "valore",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "giustificato": {
          "name": "giustificato",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "note": {
          "name": "note",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "sanction_player_id_player_id_fk": {
          "name": "sanction_player_id_player_id_fk",
          "tableFrom": "sanction",
          "tableTo": "player",
          "columnsFrom": [
            "player_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "sanction_event_id_event_id_fk": {
          "name": "sanction_event_id_event_id_fk",
          "tableFrom": "sanction",
          "tableTo": "event",
          "columnsFrom": [
            "event_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.content": {
      "name": "content",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "titolo": {
          "name": "titolo",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "corpo": {
          "name": "corpo",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "tipo": {
          "name": "tipo",
          "type": "content_tipo",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'notizia'"
        },
        "pubblicata_at": {
          "name": "pubblicata_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "autore_id": {
          "name": "autore_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "content_autore_id_user_id_fk": {
          "name": "content_autore_id_user_id_fk",
          "tableFrom": "content",
          "tableTo": "user",
          "columnsFrom": [
            "autore_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.event_registration": {
      "name": "event_registration",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "event_id": {
          "name": "event_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "player_id": {
          "name": "player_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "stato": {
          "name": "stato",
          "type": "registration_stato",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'richiesta'"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "er_event_idx": {
          "name": "er_event_idx",
          "columns": [
            {
              "expression": "event_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "event_registration_event_id_event_id_fk": {
          "name": "event_registration_event_id_event_id_fk",
          "tableFrom": "event_registration",
          "tableTo": "event",
          "columnsFrom": [
            "event_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "event_registration_player_id_player_id_fk": {
          "name": "event_registration_player_id_player_id_fk",
          "tableFrom": "event_registration",
          "tableTo": "player",
          "columnsFrom": [
            "player_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "event_registration_unique": {
          "name": "event_registration_unique",
          "nullsNotDistinct": false,
          "columns": [
            "event_id",
            "player_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.notification": {
      "name": "notification",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "tipo": {
          "name": "tipo",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "payload": {
          "name": "payload",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "canale": {
          "name": "canale",
          "type": "notification_canale",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'email'"
        },
        "inviata_at": {
          "name": "inviata_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "letta_at": {
          "name": "letta_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "notification_user_id_user_id_fk": {
          "name": "notification_user_id_user_id_fk",
          "tableFrom": "notification",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    }
  },
  "enums": {
    "public.content_tipo": {
      "name": "content_tipo",
      "schema": "public",
      "values": [
        "notizia",
        "pagina"
      ]
    },
    "public.event_stato": {
      "name": "event_stato",
      "schema": "public",
      "values": [
        "bozza",
        "iscrizioni",
        "in_corso",
        "concluso"
      ]
    },
    "public.match_stato": {
      "name": "match_stato",
      "schema": "public",
      "values": [
        "programmata",
        "in_corso",
        "conclusa",
        "resign",
        "timeout"
      ]
    },
    "public.notification_canale": {
      "name": "notification_canale",
      "schema": "public",
      "values": [
        "email",
        "push"
      ]
    },
    "public.phase_kind": {
      "name": "phase_kind",
      "schema": "public",
      "values": [
        "GIRONI_ROUND_ROBIN",
        "BRACKET_ELIMINAZIONE",
        "A_SQUADRE",
        "PARTITA_SINGOLA"
      ]
    },
    "public.phase_stato": {
      "name": "phase_stato",
      "schema": "public",
      "values": [
        "pending",
        "seeding",
        "running",
        "closed"
      ]
    },
    "public.registration_stato": {
      "name": "registration_stato",
      "schema": "public",
      "values": [
        "richiesta",
        "confermata",
        "rifiutata",
        "rinuncia",
        "in_coda"
      ]
    },
    "public.sanction_tipo": {
      "name": "sanction_tipo",
      "schema": "public",
      "values": [
        "timeout",
        "ammonizione",
        "squalifica",
        "penalizzazione",
        "ban"
      ]
    },
    "public.tipo_periodo": {
      "name": "tipo_periodo",
      "schema": "public",
      "values": [
        "estiva",
        "autunnale",
        "invernale"
      ]
    }
  },
  "schemas": {},
  "sequences": {},
  "roles": {},
  "policies": {},
  "views": {},
  "_meta": {
    "columns": {},
    "schemas": {},
    "tables": {}
  }
}