{
  "version": "5",
  "dialect": "mysql",
  "id": "4d8dcd7d-1276-4387-a7b2-76be03e40c8f",
  "prevId": "600637e4-0b32-4f9e-9055-4027d77f09ae",
  "tables": {
    "categories": {
      "name": "categories",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "name": {
          "name": "name",
          "type": "varchar(100)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "slug": {
          "name": "slug",
          "type": "varchar(100)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "icon": {
          "name": "icon",
          "type": "varchar(100)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "color": {
          "name": "color",
          "type": "varchar(7)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "categories_id": {
          "name": "categories_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "categories_name_unique": {
          "name": "categories_name_unique",
          "columns": [
            "name"
          ]
        },
        "categories_slug_unique": {
          "name": "categories_slug_unique",
          "columns": [
            "slug"
          ]
        }
      },
      "checkConstraint": {}
    },
    "channels": {
      "name": "channels",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "userId": {
          "name": "userId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "slug": {
          "name": "slug",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "avatar": {
          "name": "avatar",
          "type": "varchar(512)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "banner": {
          "name": "banner",
          "type": "varchar(512)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "subscribers": {
          "name": "subscribers",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updatedAt": {
          "name": "updatedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "channels_userId_users_id_fk": {
          "name": "channels_userId_users_id_fk",
          "tableFrom": "channels",
          "tableTo": "users",
          "columnsFrom": [
            "userId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "channels_id": {
          "name": "channels_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "channels_slug_unique": {
          "name": "channels_slug_unique",
          "columns": [
            "slug"
          ]
        }
      },
      "checkConstraint": {}
    },
    "comments": {
      "name": "comments",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "videoId": {
          "name": "videoId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "userId": {
          "name": "userId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "parentCommentId": {
          "name": "parentCommentId",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "content": {
          "name": "content",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "likes": {
          "name": "likes",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        },
        "isSpam": {
          "name": "isSpam",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        },
        "isOffensive": {
          "name": "isOffensive",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updatedAt": {
          "name": "updatedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "comments_videoId_videos_id_fk": {
          "name": "comments_videoId_videos_id_fk",
          "tableFrom": "comments",
          "tableTo": "videos",
          "columnsFrom": [
            "videoId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "comments_userId_users_id_fk": {
          "name": "comments_userId_users_id_fk",
          "tableFrom": "comments",
          "tableTo": "users",
          "columnsFrom": [
            "userId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "comments_id": {
          "name": "comments_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "notifications": {
      "name": "notifications",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "userId": {
          "name": "userId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "type": {
          "name": "type",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "title": {
          "name": "title",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "content": {
          "name": "content",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "relatedVideoId": {
          "name": "relatedVideoId",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "relatedChannelId": {
          "name": "relatedChannelId",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "read": {
          "name": "read",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "notifications_userId_users_id_fk": {
          "name": "notifications_userId_users_id_fk",
          "tableFrom": "notifications",
          "tableTo": "users",
          "columnsFrom": [
            "userId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "notifications_relatedVideoId_videos_id_fk": {
          "name": "notifications_relatedVideoId_videos_id_fk",
          "tableFrom": "notifications",
          "tableTo": "videos",
          "columnsFrom": [
            "relatedVideoId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "notifications_relatedChannelId_channels_id_fk": {
          "name": "notifications_relatedChannelId_channels_id_fk",
          "tableFrom": "notifications",
          "tableTo": "channels",
          "columnsFrom": [
            "relatedChannelId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "notifications_id": {
          "name": "notifications_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "playlistVideos": {
      "name": "playlistVideos",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "playlistId": {
          "name": "playlistId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "videoId": {
          "name": "videoId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "position": {
          "name": "position",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "addedAt": {
          "name": "addedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "playlistVideos_playlistId_playlists_id_fk": {
          "name": "playlistVideos_playlistId_playlists_id_fk",
          "tableFrom": "playlistVideos",
          "tableTo": "playlists",
          "columnsFrom": [
            "playlistId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "playlistVideos_videoId_videos_id_fk": {
          "name": "playlistVideos_videoId_videos_id_fk",
          "tableFrom": "playlistVideos",
          "tableTo": "videos",
          "columnsFrom": [
            "videoId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "playlistVideos_id": {
          "name": "playlistVideos_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "playlists": {
      "name": "playlists",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "userId": {
          "name": "userId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "title": {
          "name": "title",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "thumbnail": {
          "name": "thumbnail",
          "type": "varchar(512)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "visibility": {
          "name": "visibility",
          "type": "enum('public','private')",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": "'private'"
        },
        "videoCount": {
          "name": "videoCount",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updatedAt": {
          "name": "updatedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "playlists_userId_users_id_fk": {
          "name": "playlists_userId_users_id_fk",
          "tableFrom": "playlists",
          "tableTo": "users",
          "columnsFrom": [
            "userId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "playlists_id": {
          "name": "playlists_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "subscriptions": {
      "name": "subscriptions",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "userId": {
          "name": "userId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "channelId": {
          "name": "channelId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "subscriptions_userId_users_id_fk": {
          "name": "subscriptions_userId_users_id_fk",
          "tableFrom": "subscriptions",
          "tableTo": "users",
          "columnsFrom": [
            "userId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "subscriptions_channelId_channels_id_fk": {
          "name": "subscriptions_channelId_channels_id_fk",
          "tableFrom": "subscriptions",
          "tableTo": "channels",
          "columnsFrom": [
            "channelId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "subscriptions_id": {
          "name": "subscriptions_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "userPreferences": {
      "name": "userPreferences",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "userId": {
          "name": "userId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "preferredCategories": {
          "name": "preferredCategories",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "notificationsEnabled": {
          "name": "notificationsEnabled",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 1
        },
        "theme": {
          "name": "theme",
          "type": "varchar(20)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": "'dark'"
        },
        "language": {
          "name": "language",
          "type": "varchar(10)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": "'pt-BR'"
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updatedAt": {
          "name": "updatedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "userPreferences_userId_users_id_fk": {
          "name": "userPreferences_userId_users_id_fk",
          "tableFrom": "userPreferences",
          "tableTo": "users",
          "columnsFrom": [
            "userId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "userPreferences_id": {
          "name": "userPreferences_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "userPreferences_userId_unique": {
          "name": "userPreferences_userId_unique",
          "columns": [
            "userId"
          ]
        }
      },
      "checkConstraint": {}
    },
    "users": {
      "name": "users",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "openId": {
          "name": "openId",
          "type": "varchar(64)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "email": {
          "name": "email",
          "type": "varchar(320)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "loginMethod": {
          "name": "loginMethod",
          "type": "varchar(64)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "avatar": {
          "name": "avatar",
          "type": "varchar(512)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "bio": {
          "name": "bio",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "role": {
          "name": "role",
          "type": "enum('user','admin')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'user'"
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updatedAt": {
          "name": "updatedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        },
        "lastSignedIn": {
          "name": "lastSignedIn",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "users_id": {
          "name": "users_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "users_openId_unique": {
          "name": "users_openId_unique",
          "columns": [
            "openId"
          ]
        }
      },
      "checkConstraint": {}
    },
    "videoCaptions": {
      "name": "videoCaptions",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "videoId": {
          "name": "videoId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "language": {
          "name": "language",
          "type": "varchar(10)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "content": {
          "name": "content",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "isAutoGenerated": {
          "name": "isAutoGenerated",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 1
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "videoCaptions_videoId_videos_id_fk": {
          "name": "videoCaptions_videoId_videos_id_fk",
          "tableFrom": "videoCaptions",
          "tableTo": "videos",
          "columnsFrom": [
            "videoId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "videoCaptions_id": {
          "name": "videoCaptions_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "videoInteractions": {
      "name": "videoInteractions",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "videoId": {
          "name": "videoId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "userId": {
          "name": "userId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "type": {
          "name": "type",
          "type": "enum('like','dislike')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "videoInteractions_videoId_videos_id_fk": {
          "name": "videoInteractions_videoId_videos_id_fk",
          "tableFrom": "videoInteractions",
          "tableTo": "videos",
          "columnsFrom": [
            "videoId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "videoInteractions_userId_users_id_fk": {
          "name": "videoInteractions_userId_users_id_fk",
          "tableFrom": "videoInteractions",
          "tableTo": "users",
          "columnsFrom": [
            "userId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "videoInteractions_id": {
          "name": "videoInteractions_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "videos": {
      "name": "videos",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "channelId": {
          "name": "channelId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "categoryId": {
          "name": "categoryId",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "title": {
          "name": "title",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "slug": {
          "name": "slug",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "thumbnail": {
          "name": "thumbnail",
          "type": "varchar(512)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "videoUrl": {
          "name": "videoUrl",
          "type": "varchar(512)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "youtubeId": {
          "name": "youtubeId",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "duration": {
          "name": "duration",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        },
        "views": {
          "name": "views",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        },
        "likes": {
          "name": "likes",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        },
        "dislikes": {
          "name": "dislikes",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        },
        "commentsCount": {
          "name": "commentsCount",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        },
        "visibility": {
          "name": "visibility",
          "type": "enum('public','unlisted','private')",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": "'public'"
        },
        "tags": {
          "name": "tags",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "publishedAt": {
          "name": "publishedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "updatedAt": {
          "name": "updatedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "videos_channelId_channels_id_fk": {
          "name": "videos_channelId_channels_id_fk",
          "tableFrom": "videos",
          "tableTo": "channels",
          "columnsFrom": [
            "channelId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "videos_categoryId_categories_id_fk": {
          "name": "videos_categoryId_categories_id_fk",
          "tableFrom": "videos",
          "tableTo": "categories",
          "columnsFrom": [
            "categoryId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "videos_id": {
          "name": "videos_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "videos_slug_unique": {
          "name": "videos_slug_unique",
          "columns": [
            "slug"
          ]
        }
      },
      "checkConstraint": {}
    },
    "watchHistory": {
      "name": "watchHistory",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "userId": {
          "name": "userId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "videoId": {
          "name": "videoId",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "watchedAt": {
          "name": "watchedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "watchDuration": {
          "name": "watchDuration",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        },
        "categoryId": {
          "name": "categoryId",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "watchHistory_userId_users_id_fk": {
          "name": "watchHistory_userId_users_id_fk",
          "tableFrom": "watchHistory",
          "tableTo": "users",
          "columnsFrom": [
            "userId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "watchHistory_videoId_videos_id_fk": {
          "name": "watchHistory_videoId_videos_id_fk",
          "tableFrom": "watchHistory",
          "tableTo": "videos",
          "columnsFrom": [
            "videoId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "watchHistory_categoryId_categories_id_fk": {
          "name": "watchHistory_categoryId_categories_id_fk",
          "tableFrom": "watchHistory",
          "tableTo": "categories",
          "columnsFrom": [
            "categoryId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "watchHistory_id": {
          "name": "watchHistory_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    }
  },
  "views": {},
  "_meta": {
    "schemas": {},
    "tables": {},
    "columns": {}
  },
  "internal": {
    "tables": {},
    "indexes": {}
  }
}