{
  "id": "7f602a81-e31e-4f52-af18-c92af2386916",
  "prevId": "16656257-fbf8-4dee-91f1-43d6ad4216cc",
  "version": "7",
  "dialect": "postgresql",
  "tables": {
    "public.activity_log": {
      "name": "activity_log",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "details": {
          "name": "details",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "ip": {
          "name": "ip",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "server_id": {
          "name": "server_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "activity_log_user_idx": {
          "name": "activity_log_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "activity_log_type_idx": {
          "name": "activity_log_type_idx",
          "columns": [
            {
              "expression": "type",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "activity_log_created_idx": {
          "name": "activity_log_created_idx",
          "columns": [
            {
              "expression": "created_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "activity_log_user_created_idx": {
          "name": "activity_log_user_created_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "created_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "activity_log_type_created_idx": {
          "name": "activity_log_type_created_idx",
          "columns": [
            {
              "expression": "type",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "created_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "activity_log_server_idx": {
          "name": "activity_log_server_idx",
          "columns": [
            {
              "expression": "server_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "activity_log_user_id_users_id_fk": {
          "name": "activity_log_user_id_users_id_fk",
          "tableFrom": "activity_log",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "activity_log_server_id_servers_id_fk": {
          "name": "activity_log_server_id_servers_id_fk",
          "tableFrom": "activity_log",
          "tableTo": "servers",
          "columnsFrom": [
            "server_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.automod_rules": {
      "name": "automod_rules",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "server_id": {
          "name": "server_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "enabled": {
          "name": "enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "config": {
          "name": "config",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true
        },
        "actions": {
          "name": "actions",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true
        },
        "exempt_role_ids": {
          "name": "exempt_role_ids",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true,
          "default": "'[]'::jsonb"
        },
        "exempt_channel_ids": {
          "name": "exempt_channel_ids",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true,
          "default": "'[]'::jsonb"
        },
        "created_by": {
          "name": "created_by",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "automod_rules_server_idx": {
          "name": "automod_rules_server_idx",
          "columns": [
            {
              "expression": "server_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "automod_rules_type_idx": {
          "name": "automod_rules_type_idx",
          "columns": [
            {
              "expression": "type",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "automod_rules_enabled_idx": {
          "name": "automod_rules_enabled_idx",
          "columns": [
            {
              "expression": "enabled",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "automod_rules_server_id_servers_id_fk": {
          "name": "automod_rules_server_id_servers_id_fk",
          "tableFrom": "automod_rules",
          "tableTo": "servers",
          "columnsFrom": [
            "server_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "automod_rules_created_by_users_id_fk": {
          "name": "automod_rules_created_by_users_id_fk",
          "tableFrom": "automod_rules",
          "tableTo": "users",
          "columnsFrom": [
            "created_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.categories": {
      "name": "categories",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "position": {
          "name": "position",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "server_id": {
          "name": "server_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "categories_position_idx": {
          "name": "categories_position_idx",
          "columns": [
            {
              "expression": "position",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "categories_server_idx": {
          "name": "categories_server_idx",
          "columns": [
            {
              "expression": "server_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "categories_server_id_servers_id_fk": {
          "name": "categories_server_id_servers_id_fk",
          "tableFrom": "categories",
          "tableTo": "servers",
          "columnsFrom": [
            "server_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.channel_notification_settings": {
      "name": "channel_notification_settings",
      "schema": "",
      "columns": {
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "channel_id": {
          "name": "channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "level": {
          "name": "level",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'default'"
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "channel_notif_user_idx": {
          "name": "channel_notif_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "channel_notif_channel_idx": {
          "name": "channel_notif_channel_idx",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "channel_notification_settings_user_id_users_id_fk": {
          "name": "channel_notification_settings_user_id_users_id_fk",
          "tableFrom": "channel_notification_settings",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "channel_notification_settings_channel_id_channels_id_fk": {
          "name": "channel_notification_settings_channel_id_channels_id_fk",
          "tableFrom": "channel_notification_settings",
          "tableTo": "channels",
          "columnsFrom": [
            "channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "channel_notification_settings_user_id_channel_id_pk": {
          "name": "channel_notification_settings_user_id_channel_id_pk",
          "columns": [
            "user_id",
            "channel_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.channel_read_states": {
      "name": "channel_read_states",
      "schema": "",
      "columns": {
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "channel_id": {
          "name": "channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "last_read_message_id": {
          "name": "last_read_message_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "last_read_at": {
          "name": "last_read_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "channel_read_states_user_idx": {
          "name": "channel_read_states_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "channel_read_states_channel_idx": {
          "name": "channel_read_states_channel_idx",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "channel_read_states_last_read_idx": {
          "name": "channel_read_states_last_read_idx",
          "columns": [
            {
              "expression": "last_read_message_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "channel_read_states_user_id_users_id_fk": {
          "name": "channel_read_states_user_id_users_id_fk",
          "tableFrom": "channel_read_states",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "channel_read_states_channel_id_channels_id_fk": {
          "name": "channel_read_states_channel_id_channels_id_fk",
          "tableFrom": "channel_read_states",
          "tableTo": "channels",
          "columnsFrom": [
            "channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "channel_read_states_last_read_message_id_messages_id_fk": {
          "name": "channel_read_states_last_read_message_id_messages_id_fk",
          "tableFrom": "channel_read_states",
          "tableTo": "messages",
          "columnsFrom": [
            "last_read_message_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "channel_read_states_user_id_channel_id_pk": {
          "name": "channel_read_states_user_id_channel_id_pk",
          "columns": [
            "user_id",
            "channel_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.channel_role_permissions": {
      "name": "channel_role_permissions",
      "schema": "",
      "columns": {
        "channel_id": {
          "name": "channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "role_id": {
          "name": "role_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "permission": {
          "name": "permission",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "allow": {
          "name": "allow",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "channel_role_permissions_channel_idx": {
          "name": "channel_role_permissions_channel_idx",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "channel_role_permissions_role_idx": {
          "name": "channel_role_permissions_role_idx",
          "columns": [
            {
              "expression": "role_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "channel_role_permissions_channel_perm_idx": {
          "name": "channel_role_permissions_channel_perm_idx",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "permission",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "channel_role_permissions_role_perm_idx": {
          "name": "channel_role_permissions_role_perm_idx",
          "columns": [
            {
              "expression": "role_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "permission",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "channel_role_permissions_allow_idx": {
          "name": "channel_role_permissions_allow_idx",
          "columns": [
            {
              "expression": "allow",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "channel_role_permissions_channel_id_channels_id_fk": {
          "name": "channel_role_permissions_channel_id_channels_id_fk",
          "tableFrom": "channel_role_permissions",
          "tableTo": "channels",
          "columnsFrom": [
            "channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "channel_role_permissions_role_id_roles_id_fk": {
          "name": "channel_role_permissions_role_id_roles_id_fk",
          "tableFrom": "channel_role_permissions",
          "tableTo": "roles",
          "columnsFrom": [
            "role_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "channel_role_permissions_channel_id_role_id_permission_pk": {
          "name": "channel_role_permissions_channel_id_role_id_permission_pk",
          "columns": [
            "channel_id",
            "role_id",
            "permission"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.channel_user_permissions": {
      "name": "channel_user_permissions",
      "schema": "",
      "columns": {
        "channel_id": {
          "name": "channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "permission": {
          "name": "permission",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "allow": {
          "name": "allow",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "channel_user_permissions_channel_idx": {
          "name": "channel_user_permissions_channel_idx",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "channel_user_permissions_user_idx": {
          "name": "channel_user_permissions_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "channel_user_permissions_channel_perm_idx": {
          "name": "channel_user_permissions_channel_perm_idx",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "permission",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "channel_user_permissions_user_perm_idx": {
          "name": "channel_user_permissions_user_perm_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "permission",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "channel_user_permissions_allow_idx": {
          "name": "channel_user_permissions_allow_idx",
          "columns": [
            {
              "expression": "allow",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "channel_user_permissions_channel_id_channels_id_fk": {
          "name": "channel_user_permissions_channel_id_channels_id_fk",
          "tableFrom": "channel_user_permissions",
          "tableTo": "channels",
          "columnsFrom": [
            "channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "channel_user_permissions_user_id_users_id_fk": {
          "name": "channel_user_permissions_user_id_users_id_fk",
          "tableFrom": "channel_user_permissions",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "channel_user_permissions_channel_id_user_id_permission_pk": {
          "name": "channel_user_permissions_channel_id_user_id_permission_pk",
          "columns": [
            "channel_id",
            "user_id",
            "permission"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.channels": {
      "name": "channels",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "topic": {
          "name": "topic",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "file_access_token": {
          "name": "file_access_token",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "file_access_token_updated_at": {
          "name": "file_access_token_updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "private": {
          "name": "private",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "position": {
          "name": "position",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "category_id": {
          "name": "category_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "server_id": {
          "name": "server_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "slow_mode": {
          "name": "slow_mode",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "parent_channel_id": {
          "name": "parent_channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "archived": {
          "name": "archived",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "auto_archive_duration": {
          "name": "auto_archive_duration",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 1440
        },
        "forum_default_sort": {
          "name": "forum_default_sort",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'latest'"
        },
        "e2ee": {
          "name": "e2ee",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "channels_category_idx": {
          "name": "channels_category_idx",
          "columns": [
            {
              "expression": "category_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "channels_position_idx": {
          "name": "channels_position_idx",
          "columns": [
            {
              "expression": "position",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "channels_type_idx": {
          "name": "channels_type_idx",
          "columns": [
            {
              "expression": "type",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "channels_category_position_idx": {
          "name": "channels_category_position_idx",
          "columns": [
            {
              "expression": "category_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "position",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "channels_server_idx": {
          "name": "channels_server_idx",
          "columns": [
            {
              "expression": "server_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "channels_parent_idx": {
          "name": "channels_parent_idx",
          "columns": [
            {
              "expression": "parent_channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "channels_category_id_categories_id_fk": {
          "name": "channels_category_id_categories_id_fk",
          "tableFrom": "channels",
          "tableTo": "categories",
          "columnsFrom": [
            "category_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "channels_server_id_servers_id_fk": {
          "name": "channels_server_id_servers_id_fk",
          "tableFrom": "channels",
          "tableTo": "servers",
          "columnsFrom": [
            "server_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "channels_file_access_token_unique": {
          "name": "channels_file_access_token_unique",
          "nullsNotDistinct": false,
          "columns": [
            "file_access_token"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.dm_channel_members": {
      "name": "dm_channel_members",
      "schema": "",
      "columns": {
        "dm_channel_id": {
          "name": "dm_channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "dm_channel_members_channel_idx": {
          "name": "dm_channel_members_channel_idx",
          "columns": [
            {
              "expression": "dm_channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "dm_channel_members_user_idx": {
          "name": "dm_channel_members_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "dm_channel_members_dm_channel_id_dm_channels_id_fk": {
          "name": "dm_channel_members_dm_channel_id_dm_channels_id_fk",
          "tableFrom": "dm_channel_members",
          "tableTo": "dm_channels",
          "columnsFrom": [
            "dm_channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "dm_channel_members_user_id_users_id_fk": {
          "name": "dm_channel_members_user_id_users_id_fk",
          "tableFrom": "dm_channel_members",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "dm_channel_members_dm_channel_id_user_id_pk": {
          "name": "dm_channel_members_dm_channel_id_user_id_pk",
          "columns": [
            "dm_channel_id",
            "user_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.dm_channels": {
      "name": "dm_channels",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "owner_id": {
          "name": "owner_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "icon_file_id": {
          "name": "icon_file_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "is_group": {
          "name": "is_group",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "e2ee": {
          "name": "e2ee",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "dm_channels_owner_id_users_id_fk": {
          "name": "dm_channels_owner_id_users_id_fk",
          "tableFrom": "dm_channels",
          "tableTo": "users",
          "columnsFrom": [
            "owner_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "dm_channels_icon_file_id_files_id_fk": {
          "name": "dm_channels_icon_file_id_files_id_fk",
          "tableFrom": "dm_channels",
          "tableTo": "files",
          "columnsFrom": [
            "icon_file_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.dm_message_files": {
      "name": "dm_message_files",
      "schema": "",
      "columns": {
        "dm_message_id": {
          "name": "dm_message_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "file_id": {
          "name": "file_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "dm_message_files_msg_idx": {
          "name": "dm_message_files_msg_idx",
          "columns": [
            {
              "expression": "dm_message_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "dm_message_files_file_idx": {
          "name": "dm_message_files_file_idx",
          "columns": [
            {
              "expression": "file_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "dm_message_files_dm_message_id_dm_messages_id_fk": {
          "name": "dm_message_files_dm_message_id_dm_messages_id_fk",
          "tableFrom": "dm_message_files",
          "tableTo": "dm_messages",
          "columnsFrom": [
            "dm_message_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "dm_message_files_file_id_files_id_fk": {
          "name": "dm_message_files_file_id_files_id_fk",
          "tableFrom": "dm_message_files",
          "tableTo": "files",
          "columnsFrom": [
            "file_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "dm_message_files_dm_message_id_file_id_pk": {
          "name": "dm_message_files_dm_message_id_file_id_pk",
          "columns": [
            "dm_message_id",
            "file_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.dm_message_reactions": {
      "name": "dm_message_reactions",
      "schema": "",
      "columns": {
        "dm_message_id": {
          "name": "dm_message_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "emoji": {
          "name": "emoji",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "file_id": {
          "name": "file_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "dm_reaction_msg_idx": {
          "name": "dm_reaction_msg_idx",
          "columns": [
            {
              "expression": "dm_message_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "dm_reaction_emoji_idx": {
          "name": "dm_reaction_emoji_idx",
          "columns": [
            {
              "expression": "emoji",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "dm_reaction_user_idx": {
          "name": "dm_reaction_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "dm_message_reactions_dm_message_id_dm_messages_id_fk": {
          "name": "dm_message_reactions_dm_message_id_dm_messages_id_fk",
          "tableFrom": "dm_message_reactions",
          "tableTo": "dm_messages",
          "columnsFrom": [
            "dm_message_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "dm_message_reactions_user_id_users_id_fk": {
          "name": "dm_message_reactions_user_id_users_id_fk",
          "tableFrom": "dm_message_reactions",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "dm_message_reactions_file_id_files_id_fk": {
          "name": "dm_message_reactions_file_id_files_id_fk",
          "tableFrom": "dm_message_reactions",
          "tableTo": "files",
          "columnsFrom": [
            "file_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "dm_message_reactions_dm_message_id_user_id_emoji_pk": {
          "name": "dm_message_reactions_dm_message_id_user_id_emoji_pk",
          "columns": [
            "dm_message_id",
            "user_id",
            "emoji"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.dm_messages": {
      "name": "dm_messages",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "content": {
          "name": "content",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "encrypted_content": {
          "name": "encrypted_content",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "e2ee": {
          "name": "e2ee",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "dm_channel_id": {
          "name": "dm_channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "metadata": {
          "name": "metadata",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "reply_to_id": {
          "name": "reply_to_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "pinned": {
          "name": "pinned",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "pinned_at": {
          "name": "pinned_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        },
        "pinned_by": {
          "name": "pinned_by",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "edited": {
          "name": "edited",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "type": {
          "name": "type",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'user'"
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "dm_messages_user_idx": {
          "name": "dm_messages_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "dm_messages_channel_idx": {
          "name": "dm_messages_channel_idx",
          "columns": [
            {
              "expression": "dm_channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "dm_messages_created_idx": {
          "name": "dm_messages_created_idx",
          "columns": [
            {
              "expression": "created_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "dm_messages_channel_created_idx": {
          "name": "dm_messages_channel_created_idx",
          "columns": [
            {
              "expression": "dm_channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "created_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "dm_messages_pinned_idx": {
          "name": "dm_messages_pinned_idx",
          "columns": [
            {
              "expression": "pinned",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "dm_messages_channel_pinned_idx": {
          "name": "dm_messages_channel_pinned_idx",
          "columns": [
            {
              "expression": "dm_channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "pinned",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "dm_messages_user_id_users_id_fk": {
          "name": "dm_messages_user_id_users_id_fk",
          "tableFrom": "dm_messages",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "dm_messages_dm_channel_id_dm_channels_id_fk": {
          "name": "dm_messages_dm_channel_id_dm_channels_id_fk",
          "tableFrom": "dm_messages",
          "tableTo": "dm_channels",
          "columnsFrom": [
            "dm_channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "dm_messages_pinned_by_users_id_fk": {
          "name": "dm_messages_pinned_by_users_id_fk",
          "tableFrom": "dm_messages",
          "tableTo": "users",
          "columnsFrom": [
            "pinned_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.dm_read_states": {
      "name": "dm_read_states",
      "schema": "",
      "columns": {
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "dm_channel_id": {
          "name": "dm_channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "last_read_message_id": {
          "name": "last_read_message_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "last_read_at": {
          "name": "last_read_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "dm_read_states_user_idx": {
          "name": "dm_read_states_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "dm_read_states_channel_idx": {
          "name": "dm_read_states_channel_idx",
          "columns": [
            {
              "expression": "dm_channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "dm_read_states_user_id_users_id_fk": {
          "name": "dm_read_states_user_id_users_id_fk",
          "tableFrom": "dm_read_states",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "dm_read_states_dm_channel_id_dm_channels_id_fk": {
          "name": "dm_read_states_dm_channel_id_dm_channels_id_fk",
          "tableFrom": "dm_read_states",
          "tableTo": "dm_channels",
          "columnsFrom": [
            "dm_channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "dm_read_states_last_read_message_id_dm_messages_id_fk": {
          "name": "dm_read_states_last_read_message_id_dm_messages_id_fk",
          "tableFrom": "dm_read_states",
          "tableTo": "dm_messages",
          "columnsFrom": [
            "last_read_message_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "dm_read_states_user_id_dm_channel_id_pk": {
          "name": "dm_read_states_user_id_dm_channel_id_pk",
          "columns": [
            "user_id",
            "dm_channel_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.e2ee_sender_keys": {
      "name": "e2ee_sender_keys",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "channel_id": {
          "name": "channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "from_user_id": {
          "name": "from_user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "to_user_id": {
          "name": "to_user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "distribution_message": {
          "name": "distribution_message",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "e2ee_sender_keys_channel_idx": {
          "name": "e2ee_sender_keys_channel_idx",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "e2ee_sender_keys_from_idx": {
          "name": "e2ee_sender_keys_from_idx",
          "columns": [
            {
              "expression": "from_user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "e2ee_sender_keys_to_idx": {
          "name": "e2ee_sender_keys_to_idx",
          "columns": [
            {
              "expression": "to_user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "e2ee_sender_keys_channel_to_idx": {
          "name": "e2ee_sender_keys_channel_to_idx",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "to_user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "e2ee_sender_keys_channel_id_channels_id_fk": {
          "name": "e2ee_sender_keys_channel_id_channels_id_fk",
          "tableFrom": "e2ee_sender_keys",
          "tableTo": "channels",
          "columnsFrom": [
            "channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "e2ee_sender_keys_from_user_id_users_id_fk": {
          "name": "e2ee_sender_keys_from_user_id_users_id_fk",
          "tableFrom": "e2ee_sender_keys",
          "tableTo": "users",
          "columnsFrom": [
            "from_user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "e2ee_sender_keys_to_user_id_users_id_fk": {
          "name": "e2ee_sender_keys_to_user_id_users_id_fk",
          "tableFrom": "e2ee_sender_keys",
          "tableTo": "users",
          "columnsFrom": [
            "to_user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.emojis": {
      "name": "emojis",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "file_id": {
          "name": "file_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "server_id": {
          "name": "server_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "emojis_user_idx": {
          "name": "emojis_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "emojis_file_idx": {
          "name": "emojis_file_idx",
          "columns": [
            {
              "expression": "file_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "emojis_name_idx": {
          "name": "emojis_name_idx",
          "columns": [
            {
              "expression": "name",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "emojis_server_idx": {
          "name": "emojis_server_idx",
          "columns": [
            {
              "expression": "server_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "emojis_file_id_files_id_fk": {
          "name": "emojis_file_id_files_id_fk",
          "tableFrom": "emojis",
          "tableTo": "files",
          "columnsFrom": [
            "file_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "emojis_user_id_users_id_fk": {
          "name": "emojis_user_id_users_id_fk",
          "tableFrom": "emojis",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "emojis_server_id_servers_id_fk": {
          "name": "emojis_server_id_servers_id_fk",
          "tableFrom": "emojis",
          "tableTo": "servers",
          "columnsFrom": [
            "server_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "emojis_name_unique": {
          "name": "emojis_name_unique",
          "nullsNotDistinct": false,
          "columns": [
            "name"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.federation_instances": {
      "name": "federation_instances",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "domain": {
          "name": "domain",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "public_key": {
          "name": "public_key",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'pending'"
        },
        "direction": {
          "name": "direction",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "added_by": {
          "name": "added_by",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "last_seen_at": {
          "name": "last_seen_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "federation_instances_domain_idx": {
          "name": "federation_instances_domain_idx",
          "columns": [
            {
              "expression": "domain",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "federation_instances_status_idx": {
          "name": "federation_instances_status_idx",
          "columns": [
            {
              "expression": "status",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "federation_instances_added_by_users_id_fk": {
          "name": "federation_instances_added_by_users_id_fk",
          "tableFrom": "federation_instances",
          "tableTo": "users",
          "columnsFrom": [
            "added_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.federation_keys": {
      "name": "federation_keys",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "public_key": {
          "name": "public_key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "private_key": {
          "name": "private_key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.files": {
      "name": "files",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "original_name": {
          "name": "original_name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "md5": {
          "name": "md5",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "size": {
          "name": "size",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "mime_type": {
          "name": "mime_type",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "extension": {
          "name": "extension",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "encrypted": {
          "name": "encrypted",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "files_user_idx": {
          "name": "files_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "files_md5_idx": {
          "name": "files_md5_idx",
          "columns": [
            {
              "expression": "md5",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "files_created_idx": {
          "name": "files_created_idx",
          "columns": [
            {
              "expression": "created_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "files_name_idx": {
          "name": "files_name_idx",
          "columns": [
            {
              "expression": "name",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "files_name_unique": {
          "name": "files_name_unique",
          "nullsNotDistinct": false,
          "columns": [
            "name"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.forum_post_tags": {
      "name": "forum_post_tags",
      "schema": "",
      "columns": {
        "thread_id": {
          "name": "thread_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "tag_id": {
          "name": "tag_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "forum_post_tags_thread_id_channels_id_fk": {
          "name": "forum_post_tags_thread_id_channels_id_fk",
          "tableFrom": "forum_post_tags",
          "tableTo": "channels",
          "columnsFrom": [
            "thread_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "forum_post_tags_tag_id_forum_tags_id_fk": {
          "name": "forum_post_tags_tag_id_forum_tags_id_fk",
          "tableFrom": "forum_post_tags",
          "tableTo": "forum_tags",
          "columnsFrom": [
            "tag_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "forum_post_tags_thread_id_tag_id_pk": {
          "name": "forum_post_tags_thread_id_tag_id_pk",
          "columns": [
            "thread_id",
            "tag_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.forum_tags": {
      "name": "forum_tags",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "channel_id": {
          "name": "channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "color": {
          "name": "color",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'#808080'"
        },
        "emoji_id": {
          "name": "emoji_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "forum_tags_channel_idx": {
          "name": "forum_tags_channel_idx",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "forum_tags_channel_id_channels_id_fk": {
          "name": "forum_tags_channel_id_channels_id_fk",
          "tableFrom": "forum_tags",
          "tableTo": "channels",
          "columnsFrom": [
            "channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "forum_tags_emoji_id_emojis_id_fk": {
          "name": "forum_tags_emoji_id_emojis_id_fk",
          "tableFrom": "forum_tags",
          "tableTo": "emojis",
          "columnsFrom": [
            "emoji_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.friend_requests": {
      "name": "friend_requests",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "sender_id": {
          "name": "sender_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "receiver_id": {
          "name": "receiver_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'pending'"
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "friend_requests_sender_idx": {
          "name": "friend_requests_sender_idx",
          "columns": [
            {
              "expression": "sender_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "friend_requests_receiver_idx": {
          "name": "friend_requests_receiver_idx",
          "columns": [
            {
              "expression": "receiver_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "friend_requests_status_idx": {
          "name": "friend_requests_status_idx",
          "columns": [
            {
              "expression": "status",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "friend_requests_pair_idx": {
          "name": "friend_requests_pair_idx",
          "columns": [
            {
              "expression": "sender_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "receiver_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "friend_requests_sender_id_users_id_fk": {
          "name": "friend_requests_sender_id_users_id_fk",
          "tableFrom": "friend_requests",
          "tableTo": "users",
          "columnsFrom": [
            "sender_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "friend_requests_receiver_id_users_id_fk": {
          "name": "friend_requests_receiver_id_users_id_fk",
          "tableFrom": "friend_requests",
          "tableTo": "users",
          "columnsFrom": [
            "receiver_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.friendships": {
      "name": "friendships",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "friend_id": {
          "name": "friend_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "friendships_user_idx": {
          "name": "friendships_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "friendships_friend_idx": {
          "name": "friendships_friend_idx",
          "columns": [
            {
              "expression": "friend_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "friendships_pair_idx": {
          "name": "friendships_pair_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "friend_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "friendships_user_id_users_id_fk": {
          "name": "friendships_user_id_users_id_fk",
          "tableFrom": "friendships",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "friendships_friend_id_users_id_fk": {
          "name": "friendships_friend_id_users_id_fk",
          "tableFrom": "friendships",
          "tableTo": "users",
          "columnsFrom": [
            "friend_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.invites": {
      "name": "invites",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "code": {
          "name": "code",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "creator_id": {
          "name": "creator_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "server_id": {
          "name": "server_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "max_uses": {
          "name": "max_uses",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "uses": {
          "name": "uses",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "expires_at": {
          "name": "expires_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "invites_code_idx": {
          "name": "invites_code_idx",
          "columns": [
            {
              "expression": "code",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "invites_creator_idx": {
          "name": "invites_creator_idx",
          "columns": [
            {
              "expression": "creator_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "invites_server_idx": {
          "name": "invites_server_idx",
          "columns": [
            {
              "expression": "server_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "invites_expires_idx": {
          "name": "invites_expires_idx",
          "columns": [
            {
              "expression": "expires_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "invites_uses_idx": {
          "name": "invites_uses_idx",
          "columns": [
            {
              "expression": "uses",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "invites_creator_id_users_id_fk": {
          "name": "invites_creator_id_users_id_fk",
          "tableFrom": "invites",
          "tableTo": "users",
          "columnsFrom": [
            "creator_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "invites_server_id_servers_id_fk": {
          "name": "invites_server_id_servers_id_fk",
          "tableFrom": "invites",
          "tableTo": "servers",
          "columnsFrom": [
            "server_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "invites_code_unique": {
          "name": "invites_code_unique",
          "nullsNotDistinct": false,
          "columns": [
            "code"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.logins": {
      "name": "logins",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "user_agent": {
          "name": "user_agent",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "os": {
          "name": "os",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "device": {
          "name": "device",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "ip": {
          "name": "ip",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "hostname": {
          "name": "hostname",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "city": {
          "name": "city",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "region": {
          "name": "region",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "country": {
          "name": "country",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "loc": {
          "name": "loc",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "org": {
          "name": "org",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "postal": {
          "name": "postal",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "timezone": {
          "name": "timezone",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "logins_user_idx": {
          "name": "logins_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "logins_ip_idx": {
          "name": "logins_ip_idx",
          "columns": [
            {
              "expression": "ip",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "logins_created_idx": {
          "name": "logins_created_idx",
          "columns": [
            {
              "expression": "created_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "logins_user_created_idx": {
          "name": "logins_user_created_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "created_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "logins_user_id_users_id_fk": {
          "name": "logins_user_id_users_id_fk",
          "tableFrom": "logins",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.message_files": {
      "name": "message_files",
      "schema": "",
      "columns": {
        "message_id": {
          "name": "message_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "file_id": {
          "name": "file_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "message_files_msg_idx": {
          "name": "message_files_msg_idx",
          "columns": [
            {
              "expression": "message_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "message_files_file_idx": {
          "name": "message_files_file_idx",
          "columns": [
            {
              "expression": "file_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "message_files_message_id_messages_id_fk": {
          "name": "message_files_message_id_messages_id_fk",
          "tableFrom": "message_files",
          "tableTo": "messages",
          "columnsFrom": [
            "message_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "message_files_file_id_files_id_fk": {
          "name": "message_files_file_id_files_id_fk",
          "tableFrom": "message_files",
          "tableTo": "files",
          "columnsFrom": [
            "file_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "message_files_message_id_file_id_pk": {
          "name": "message_files_message_id_file_id_pk",
          "columns": [
            "message_id",
            "file_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.message_reactions": {
      "name": "message_reactions",
      "schema": "",
      "columns": {
        "message_id": {
          "name": "message_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "emoji": {
          "name": "emoji",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "file_id": {
          "name": "file_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "reaction_msg_idx": {
          "name": "reaction_msg_idx",
          "columns": [
            {
              "expression": "message_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "reaction_emoji_idx": {
          "name": "reaction_emoji_idx",
          "columns": [
            {
              "expression": "emoji",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "reaction_user_idx": {
          "name": "reaction_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "reaction_msg_emoji_idx": {
          "name": "reaction_msg_emoji_idx",
          "columns": [
            {
              "expression": "message_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "emoji",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "message_reactions_message_id_messages_id_fk": {
          "name": "message_reactions_message_id_messages_id_fk",
          "tableFrom": "message_reactions",
          "tableTo": "messages",
          "columnsFrom": [
            "message_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "message_reactions_user_id_users_id_fk": {
          "name": "message_reactions_user_id_users_id_fk",
          "tableFrom": "message_reactions",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "message_reactions_file_id_files_id_fk": {
          "name": "message_reactions_file_id_files_id_fk",
          "tableFrom": "message_reactions",
          "tableTo": "files",
          "columnsFrom": [
            "file_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "message_reactions_message_id_user_id_emoji_pk": {
          "name": "message_reactions_message_id_user_id_emoji_pk",
          "columns": [
            "message_id",
            "user_id",
            "emoji"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.messages": {
      "name": "messages",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "content": {
          "name": "content",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "encrypted_content": {
          "name": "encrypted_content",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "e2ee": {
          "name": "e2ee",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "channel_id": {
          "name": "channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "editable": {
          "name": "editable",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "metadata": {
          "name": "metadata",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "reply_to_id": {
          "name": "reply_to_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "pinned": {
          "name": "pinned",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "pinned_at": {
          "name": "pinned_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        },
        "pinned_by": {
          "name": "pinned_by",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "thread_id": {
          "name": "thread_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "webhook_id": {
          "name": "webhook_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "edited": {
          "name": "edited",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "type": {
          "name": "type",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'user'"
        },
        "mentioned_user_ids": {
          "name": "mentioned_user_ids",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "mentions_all": {
          "name": "mentions_all",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "messages_user_idx": {
          "name": "messages_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "messages_channel_idx": {
          "name": "messages_channel_idx",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "messages_created_idx": {
          "name": "messages_created_idx",
          "columns": [
            {
              "expression": "created_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "messages_channel_created_idx": {
          "name": "messages_channel_created_idx",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "created_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "messages_pinned_idx": {
          "name": "messages_pinned_idx",
          "columns": [
            {
              "expression": "pinned",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "messages_channel_pinned_idx": {
          "name": "messages_channel_pinned_idx",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "pinned",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "messages_thread_idx": {
          "name": "messages_thread_idx",
          "columns": [
            {
              "expression": "thread_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "messages_webhook_idx": {
          "name": "messages_webhook_idx",
          "columns": [
            {
              "expression": "webhook_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "messages_user_id_users_id_fk": {
          "name": "messages_user_id_users_id_fk",
          "tableFrom": "messages",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "messages_channel_id_channels_id_fk": {
          "name": "messages_channel_id_channels_id_fk",
          "tableFrom": "messages",
          "tableTo": "channels",
          "columnsFrom": [
            "channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "messages_pinned_by_users_id_fk": {
          "name": "messages_pinned_by_users_id_fk",
          "tableFrom": "messages",
          "tableTo": "users",
          "columnsFrom": [
            "pinned_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "messages_thread_id_channels_id_fk": {
          "name": "messages_thread_id_channels_id_fk",
          "tableFrom": "messages",
          "tableTo": "channels",
          "columnsFrom": [
            "thread_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.plugin_data": {
      "name": "plugin_data",
      "schema": "",
      "columns": {
        "plugin_id": {
          "name": "plugin_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "server_id": {
          "name": "server_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "enabled": {
          "name": "enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "settings": {
          "name": "settings",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true,
          "default": "'{}'::jsonb"
        }
      },
      "indexes": {
        "plugin_data_server_idx": {
          "name": "plugin_data_server_idx",
          "columns": [
            {
              "expression": "server_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "plugin_data_server_id_servers_id_fk": {
          "name": "plugin_data_server_id_servers_id_fk",
          "tableFrom": "plugin_data",
          "tableTo": "servers",
          "columnsFrom": [
            "server_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "plugin_data_plugin_id_server_id_pk": {
          "name": "plugin_data_plugin_id_server_id_pk",
          "columns": [
            "plugin_id",
            "server_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.role_permissions": {
      "name": "role_permissions",
      "schema": "",
      "columns": {
        "role_id": {
          "name": "role_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "permission": {
          "name": "permission",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "role_permissions_role_idx": {
          "name": "role_permissions_role_idx",
          "columns": [
            {
              "expression": "role_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "role_permissions_permission_idx": {
          "name": "role_permissions_permission_idx",
          "columns": [
            {
              "expression": "permission",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "role_permissions_role_id_roles_id_fk": {
          "name": "role_permissions_role_id_roles_id_fk",
          "tableFrom": "role_permissions",
          "tableTo": "roles",
          "columnsFrom": [
            "role_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "role_permissions_role_id_permission_pk": {
          "name": "role_permissions_role_id_permission_pk",
          "columns": [
            "role_id",
            "permission"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.roles": {
      "name": "roles",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "color": {
          "name": "color",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'#ffffff'"
        },
        "is_persistent": {
          "name": "is_persistent",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true
        },
        "is_default": {
          "name": "is_default",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true
        },
        "server_id": {
          "name": "server_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "roles_is_default_idx": {
          "name": "roles_is_default_idx",
          "columns": [
            {
              "expression": "is_default",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "roles_is_persistent_idx": {
          "name": "roles_is_persistent_idx",
          "columns": [
            {
              "expression": "is_persistent",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "roles_server_idx": {
          "name": "roles_server_idx",
          "columns": [
            {
              "expression": "server_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "roles_server_id_servers_id_fk": {
          "name": "roles_server_id_servers_id_fk",
          "tableFrom": "roles",
          "tableTo": "servers",
          "columnsFrom": [
            "server_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.server_members": {
      "name": "server_members",
      "schema": "",
      "columns": {
        "server_id": {
          "name": "server_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "joined_at": {
          "name": "joined_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "muted": {
          "name": "muted",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "notification_level": {
          "name": "notification_level",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'default'"
        },
        "position": {
          "name": "position",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        }
      },
      "indexes": {
        "server_members_server_idx": {
          "name": "server_members_server_idx",
          "columns": [
            {
              "expression": "server_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "server_members_user_idx": {
          "name": "server_members_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "server_members_server_id_servers_id_fk": {
          "name": "server_members_server_id_servers_id_fk",
          "tableFrom": "server_members",
          "tableTo": "servers",
          "columnsFrom": [
            "server_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "server_members_user_id_users_id_fk": {
          "name": "server_members_user_id_users_id_fk",
          "tableFrom": "server_members",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "server_members_server_id_user_id_pk": {
          "name": "server_members_server_id_user_id_pk",
          "columns": [
            "server_id",
            "user_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.servers": {
      "name": "servers",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "password": {
          "name": "password",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "public_id": {
          "name": "public_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "secret_token": {
          "name": "secret_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "logo_id": {
          "name": "logo_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "owner_id": {
          "name": "owner_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "allow_new_users": {
          "name": "allow_new_users",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true
        },
        "storage_uploads_enabled": {
          "name": "storage_uploads_enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true
        },
        "storage_quota": {
          "name": "storage_quota",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "storage_upload_max_file_size": {
          "name": "storage_upload_max_file_size",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "storage_space_quota_by_user": {
          "name": "storage_space_quota_by_user",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "storage_overflow_action": {
          "name": "storage_overflow_action",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "enable_plugins": {
          "name": "enable_plugins",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true
        },
        "discoverable": {
          "name": "discoverable",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "federatable": {
          "name": "federatable",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "servers_public_id_idx": {
          "name": "servers_public_id_idx",
          "columns": [
            {
              "expression": "public_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "servers_owner_idx": {
          "name": "servers_owner_idx",
          "columns": [
            {
              "expression": "owner_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "servers_name_idx": {
          "name": "servers_name_idx",
          "columns": [
            {
              "expression": "name",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "servers_discoverable_idx": {
          "name": "servers_discoverable_idx",
          "columns": [
            {
              "expression": "discoverable",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "servers_federatable_idx": {
          "name": "servers_federatable_idx",
          "columns": [
            {
              "expression": "federatable",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "servers_logo_id_files_id_fk": {
          "name": "servers_logo_id_files_id_fk",
          "tableFrom": "servers",
          "tableTo": "files",
          "columnsFrom": [
            "logo_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "servers_owner_id_users_id_fk": {
          "name": "servers_owner_id_users_id_fk",
          "tableFrom": "servers",
          "tableTo": "users",
          "columnsFrom": [
            "owner_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "servers_public_id_unique": {
          "name": "servers_public_id_unique",
          "nullsNotDistinct": false,
          "columns": [
            "public_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.settings": {
      "name": "settings",
      "schema": "",
      "columns": {
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "password": {
          "name": "password",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "server_id": {
          "name": "server_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "secret_token": {
          "name": "secret_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "logo_id": {
          "name": "logo_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "allow_new_users": {
          "name": "allow_new_users",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true
        },
        "storage_uploads_enabled": {
          "name": "storage_uploads_enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true
        },
        "storage_quota": {
          "name": "storage_quota",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "storage_upload_max_file_size": {
          "name": "storage_upload_max_file_size",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "storage_space_quota_by_user": {
          "name": "storage_space_quota_by_user",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "storage_overflow_action": {
          "name": "storage_overflow_action",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "enable_plugins": {
          "name": "enable_plugins",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "settings_server_idx": {
          "name": "settings_server_idx",
          "columns": [
            {
              "expression": "server_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "settings_server_unique_idx": {
          "name": "settings_server_unique_idx",
          "columns": [
            {
              "expression": "server_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "settings_logo_id_files_id_fk": {
          "name": "settings_logo_id_files_id_fk",
          "tableFrom": "settings",
          "tableTo": "files",
          "columnsFrom": [
            "logo_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.user_federated_servers": {
      "name": "user_federated_servers",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "instance_id": {
          "name": "instance_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "remote_server_id": {
          "name": "remote_server_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "remote_server_public_id": {
          "name": "remote_server_public_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "remote_server_name": {
          "name": "remote_server_name",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "joined_at": {
          "name": "joined_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "ufs_user_instance_server_idx": {
          "name": "ufs_user_instance_server_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "instance_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "remote_server_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "ufs_user_idx": {
          "name": "ufs_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "user_federated_servers_user_id_users_id_fk": {
          "name": "user_federated_servers_user_id_users_id_fk",
          "tableFrom": "user_federated_servers",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "user_federated_servers_instance_id_federation_instances_id_fk": {
          "name": "user_federated_servers_instance_id_federation_instances_id_fk",
          "tableFrom": "user_federated_servers",
          "tableTo": "federation_instances",
          "columnsFrom": [
            "instance_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.user_identity_keys": {
      "name": "user_identity_keys",
      "schema": "",
      "columns": {
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true
        },
        "identity_public_key": {
          "name": "identity_public_key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "registration_id": {
          "name": "registration_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "user_identity_keys_user_id_users_id_fk": {
          "name": "user_identity_keys_user_id_users_id_fk",
          "tableFrom": "user_identity_keys",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.user_key_backups": {
      "name": "user_key_backups",
      "schema": "",
      "columns": {
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true
        },
        "encrypted_data": {
          "name": "encrypted_data",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "user_key_backups_user_id_users_id_fk": {
          "name": "user_key_backups_user_id_users_id_fk",
          "tableFrom": "user_key_backups",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.user_notes": {
      "name": "user_notes",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "author_id": {
          "name": "author_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "target_user_id": {
          "name": "target_user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "content": {
          "name": "content",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "user_notes_author_idx": {
          "name": "user_notes_author_idx",
          "columns": [
            {
              "expression": "author_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "user_notes_target_idx": {
          "name": "user_notes_target_idx",
          "columns": [
            {
              "expression": "target_user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "user_notes_author_target_idx": {
          "name": "user_notes_author_target_idx",
          "columns": [
            {
              "expression": "author_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "target_user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "user_notes_author_id_users_id_fk": {
          "name": "user_notes_author_id_users_id_fk",
          "tableFrom": "user_notes",
          "tableTo": "users",
          "columnsFrom": [
            "author_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "user_notes_target_user_id_users_id_fk": {
          "name": "user_notes_target_user_id_users_id_fk",
          "tableFrom": "user_notes",
          "tableTo": "users",
          "columnsFrom": [
            "target_user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.user_one_time_pre_keys": {
      "name": "user_one_time_pre_keys",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "key_id": {
          "name": "key_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "public_key": {
          "name": "public_key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "user_otp_keys_user_idx": {
          "name": "user_otp_keys_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "user_otp_keys_user_key_idx": {
          "name": "user_otp_keys_user_key_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "key_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "user_one_time_pre_keys_user_id_users_id_fk": {
          "name": "user_one_time_pre_keys_user_id_users_id_fk",
          "tableFrom": "user_one_time_pre_keys",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.user_roles": {
      "name": "user_roles",
      "schema": "",
      "columns": {
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "role_id": {
          "name": "role_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "user_roles_user_idx": {
          "name": "user_roles_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "user_roles_role_idx": {
          "name": "user_roles_role_idx",
          "columns": [
            {
              "expression": "role_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "user_roles_user_id_users_id_fk": {
          "name": "user_roles_user_id_users_id_fk",
          "tableFrom": "user_roles",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "user_roles_role_id_roles_id_fk": {
          "name": "user_roles_role_id_roles_id_fk",
          "tableFrom": "user_roles",
          "tableTo": "roles",
          "columnsFrom": [
            "role_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "user_roles_user_id_role_id_pk": {
          "name": "user_roles_user_id_role_id_pk",
          "columns": [
            "user_id",
            "role_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.user_signed_pre_keys": {
      "name": "user_signed_pre_keys",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "key_id": {
          "name": "key_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "public_key": {
          "name": "public_key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "signature": {
          "name": "signature",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "user_signed_pre_keys_user_idx": {
          "name": "user_signed_pre_keys_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "user_signed_pre_keys_user_key_idx": {
          "name": "user_signed_pre_keys_user_key_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "key_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "user_signed_pre_keys_user_id_users_id_fk": {
          "name": "user_signed_pre_keys_user_id_users_id_fk",
          "tableFrom": "user_signed_pre_keys",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.users": {
      "name": "users",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "supabase_id": {
          "name": "supabase_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "avatar_id": {
          "name": "avatar_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "banner_id": {
          "name": "banner_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "bio": {
          "name": "bio",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "banned": {
          "name": "banned",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "ban_reason": {
          "name": "ban_reason",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "banned_at": {
          "name": "banned_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        },
        "banner_color": {
          "name": "banner_color",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "last_login_at": {
          "name": "last_login_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "is_federated": {
          "name": "is_federated",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "federated_instance_id": {
          "name": "federated_instance_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "federated_username": {
          "name": "federated_username",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "public_id": {
          "name": "public_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "federated_public_id": {
          "name": "federated_public_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "users_supabase_id_idx": {
          "name": "users_supabase_id_idx",
          "columns": [
            {
              "expression": "supabase_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "users_name_idx": {
          "name": "users_name_idx",
          "columns": [
            {
              "expression": "name",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "users_banned_idx": {
          "name": "users_banned_idx",
          "columns": [
            {
              "expression": "banned",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "users_last_login_idx": {
          "name": "users_last_login_idx",
          "columns": [
            {
              "expression": "last_login_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "users_federated_idx": {
          "name": "users_federated_idx",
          "columns": [
            {
              "expression": "is_federated",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "users_federated_instance_idx": {
          "name": "users_federated_instance_idx",
          "columns": [
            {
              "expression": "federated_instance_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "users_federated_identity_idx": {
          "name": "users_federated_identity_idx",
          "columns": [
            {
              "expression": "federated_instance_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "federated_username",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "users_public_id_idx": {
          "name": "users_public_id_idx",
          "columns": [
            {
              "expression": "public_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "users_federated_public_id_idx": {
          "name": "users_federated_public_id_idx",
          "columns": [
            {
              "expression": "federated_public_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "users_avatar_id_files_id_fk": {
          "name": "users_avatar_id_files_id_fk",
          "tableFrom": "users",
          "tableTo": "files",
          "columnsFrom": [
            "avatar_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "users_banner_id_files_id_fk": {
          "name": "users_banner_id_files_id_fk",
          "tableFrom": "users",
          "tableTo": "files",
          "columnsFrom": [
            "banner_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "users_supabase_id_unique": {
          "name": "users_supabase_id_unique",
          "nullsNotDistinct": false,
          "columns": [
            "supabase_id"
          ]
        },
        "users_public_id_unique": {
          "name": "users_public_id_unique",
          "nullsNotDistinct": false,
          "columns": [
            "public_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.webhooks": {
      "name": "webhooks",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "channel_id": {
          "name": "channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "token": {
          "name": "token",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "avatar_file_id": {
          "name": "avatar_file_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "created_by": {
          "name": "created_by",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "server_id": {
          "name": "server_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "webhooks_token_idx": {
          "name": "webhooks_token_idx",
          "columns": [
            {
              "expression": "token",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "webhooks_channel_idx": {
          "name": "webhooks_channel_idx",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "webhooks_server_idx": {
          "name": "webhooks_server_idx",
          "columns": [
            {
              "expression": "server_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "webhooks_channel_id_channels_id_fk": {
          "name": "webhooks_channel_id_channels_id_fk",
          "tableFrom": "webhooks",
          "tableTo": "channels",
          "columnsFrom": [
            "channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "webhooks_avatar_file_id_files_id_fk": {
          "name": "webhooks_avatar_file_id_files_id_fk",
          "tableFrom": "webhooks",
          "tableTo": "files",
          "columnsFrom": [
            "avatar_file_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "webhooks_created_by_users_id_fk": {
          "name": "webhooks_created_by_users_id_fk",
          "tableFrom": "webhooks",
          "tableTo": "users",
          "columnsFrom": [
            "created_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "webhooks_server_id_servers_id_fk": {
          "name": "webhooks_server_id_servers_id_fk",
          "tableFrom": "webhooks",
          "tableTo": "servers",
          "columnsFrom": [
            "server_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "webhooks_token_unique": {
          "name": "webhooks_token_unique",
          "nullsNotDistinct": false,
          "columns": [
            "token"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    }
  },
  "enums": {},
  "schemas": {},
  "sequences": {},
  "roles": {},
  "policies": {},
  "views": {},
  "_meta": {
    "columns": {},
    "schemas": {},
    "tables": {}
  }
}