Files
BYW-VoiceHub/app/drizzle/migrations/meta/20260816000000_snapshot.json
T

2891 lines
73 KiB
JSON

{
"id": "86154d0e-9f5a-425c-b992-a6c9e355af5e",
"prevId": "37f1e737-a12c-477b-bb3f-e7c4d69edea2",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.api_key_permissions": {
"name": "api_key_permissions",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"api_key_id": {
"name": "api_key_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"permission": {
"name": "permission",
"type": "varchar(100)",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.api_keys": {
"name": "api_keys",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"key_hash": {
"name": "key_hash",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"key_prefix": {
"name": "key_prefix",
"type": "varchar(10)",
"primaryKey": false,
"notNull": true
},
"is_active": {
"name": "is_active",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"expires_at": {
"name": "expires_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"last_used_at": {
"name": "last_used_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"created_by_user_id": {
"name": "created_by_user_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"usage_count": {
"name": "usage_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"api_keys_key_hash_unique": {
"name": "api_keys_key_hash_unique",
"nullsNotDistinct": false,
"columns": [
"key_hash"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.api_logs": {
"name": "api_logs",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"api_key_id": {
"name": "api_key_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"endpoint": {
"name": "endpoint",
"type": "varchar(500)",
"primaryKey": false,
"notNull": true
},
"method": {
"name": "method",
"type": "varchar(10)",
"primaryKey": false,
"notNull": true
},
"ip_address": {
"name": "ip_address",
"type": "text",
"primaryKey": false,
"notNull": true
},
"user_agent": {
"name": "user_agent",
"type": "text",
"primaryKey": false,
"notNull": false
},
"status_code": {
"name": "status_code",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"response_time_ms": {
"name": "response_time_ms",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"request_body": {
"name": "request_body",
"type": "text",
"primaryKey": false,
"notNull": false
},
"response_body": {
"name": "response_body",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"error_message": {
"name": "error_message",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.BackupHistory": {
"name": "BackupHistory",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"filename": {
"name": "filename",
"type": "text",
"primaryKey": false,
"notNull": true
},
"totalRecords": {
"name": "totalRecords",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"backupSize": {
"name": "backupSize",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"methods": {
"name": "methods",
"type": "text",
"primaryKey": false,
"notNull": true
},
"success": {
"name": "success",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"triggeredBy": {
"name": "triggeredBy",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"backup_history_created_at_idx": {
"name": "backup_history_created_at_idx",
"columns": [
{
"expression": "createdAt",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.CardCodeRedeemLog": {
"name": "CardCodeRedeemLog",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"cardCodeId": {
"name": "cardCodeId",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"codeSnapshot": {
"name": "codeSnapshot",
"type": "text",
"primaryKey": false,
"notNull": true
},
"redeemedBy": {
"name": "redeemedBy",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"redeemedAt": {
"name": "redeemedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"source": {
"name": "source",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'UNKNOWN'"
},
"songId": {
"name": "songId",
"type": "integer",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"card_code_redeem_log_card_code_id_idx": {
"name": "card_code_redeem_log_card_code_id_idx",
"columns": [
{
"expression": "cardCodeId",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"CardCodeRedeemLog_cardCodeId_CardCode_id_fk": {
"name": "CardCodeRedeemLog_cardCodeId_CardCode_id_fk",
"tableFrom": "CardCodeRedeemLog",
"tableTo": "CardCode",
"columnsFrom": [
"cardCodeId"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"CardCodeRedeemLog_redeemedBy_User_id_fk": {
"name": "CardCodeRedeemLog_redeemedBy_User_id_fk",
"tableFrom": "CardCodeRedeemLog",
"tableTo": "User",
"columnsFrom": [
"redeemedBy"
],
"columnsTo": [
"id"
],
"onDelete": "restrict",
"onUpdate": "no action"
},
"CardCodeRedeemLog_songId_Song_id_fk": {
"name": "CardCodeRedeemLog_songId_Song_id_fk",
"tableFrom": "CardCodeRedeemLog",
"tableTo": "Song",
"columnsFrom": [
"songId"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.CardCode": {
"name": "CardCode",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"code": {
"name": "code",
"type": "text",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "card_code_status",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'AVAILABLE'"
},
"lockedBy": {
"name": "lockedBy",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"lockedAt": {
"name": "lockedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"redeemedBy": {
"name": "redeemedBy",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"redeemedAt": {
"name": "redeemedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"note": {
"name": "note",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"CardCode_lockedBy_User_id_fk": {
"name": "CardCode_lockedBy_User_id_fk",
"tableFrom": "CardCode",
"tableTo": "User",
"columnsFrom": [
"lockedBy"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"CardCode_redeemedBy_User_id_fk": {
"name": "CardCode_redeemedBy_User_id_fk",
"tableFrom": "CardCode",
"tableTo": "User",
"columnsFrom": [
"redeemedBy"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"CardCode_code_unique": {
"name": "CardCode_code_unique",
"nullsNotDistinct": false,
"columns": [
"code"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.collaboration_logs": {
"name": "collaboration_logs",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"collaborator_id": {
"name": "collaborator_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"action": {
"name": "action",
"type": "varchar(50)",
"primaryKey": false,
"notNull": true
},
"operator_id": {
"name": "operator_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"ip_address": {
"name": "ip_address",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.EmailTemplate": {
"name": "EmailTemplate",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"key": {
"name": "key",
"type": "varchar(100)",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "varchar(200)",
"primaryKey": false,
"notNull": true
},
"subject": {
"name": "subject",
"type": "varchar(300)",
"primaryKey": false,
"notNull": true
},
"html": {
"name": "html",
"type": "text",
"primaryKey": false,
"notNull": true
},
"updatedByUserId": {
"name": "updatedByUserId",
"type": "integer",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.NotificationSettings": {
"name": "NotificationSettings",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"userId": {
"name": "userId",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"songRequestEnabled": {
"name": "songRequestEnabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"songVotedEnabled": {
"name": "songVotedEnabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"songPlayedEnabled": {
"name": "songPlayedEnabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"refreshInterval": {
"name": "refreshInterval",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 60
},
"songVotedThreshold": {
"name": "songVotedThreshold",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 1
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.Notification": {
"name": "Notification",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"batchId": {
"name": "batchId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"source": {
"name": "source",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'SYSTEM'"
},
"senderId": {
"name": "senderId",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"senderName": {
"name": "senderName",
"type": "text",
"primaryKey": false,
"notNull": false
},
"senderUsername": {
"name": "senderUsername",
"type": "text",
"primaryKey": false,
"notNull": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": false
},
"message": {
"name": "message",
"type": "text",
"primaryKey": false,
"notNull": true
},
"important": {
"name": "important",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"read": {
"name": "read",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"userDeleted": {
"name": "userDeleted",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"userId": {
"name": "userId",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"songId": {
"name": "songId",
"type": "integer",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"notification_user_important_read_created_idx": {
"name": "notification_user_important_read_created_idx",
"columns": [
{
"expression": "userId",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "userDeleted",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "important",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "read",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "createdAt",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"notification_batch_id_idx": {
"name": "notification_batch_id_idx",
"columns": [
{
"expression": "batchId",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.PasswordAuditLog": {
"name": "PasswordAuditLog",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"userId": {
"name": "userId",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"actorId": {
"name": "actorId",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"action": {
"name": "action",
"type": "text",
"primaryKey": false,
"notNull": true
},
"success": {
"name": "success",
"type": "boolean",
"primaryKey": false,
"notNull": true
},
"ipAddress": {
"name": "ipAddress",
"type": "text",
"primaryKey": false,
"notNull": false
},
"userAgent": {
"name": "userAgent",
"type": "text",
"primaryKey": false,
"notNull": false
},
"failureReason": {
"name": "failureReason",
"type": "text",
"primaryKey": false,
"notNull": false
},
"createdAt": {
"name": "createdAt",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"PasswordAuditLog_user_created_idx": {
"name": "PasswordAuditLog_user_created_idx",
"columns": [
{
"expression": "userId",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "createdAt",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.PasswordRateLimit": {
"name": "PasswordRateLimit",
"schema": "",
"columns": {
"key": {
"name": "key",
"type": "text",
"primaryKey": true,
"notNull": true
},
"count": {
"name": "count",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"resetAt": {
"name": "resetAt",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
}
},
"indexes": {
"PasswordRateLimit_reset_idx": {
"name": "PasswordRateLimit_reset_idx",
"columns": [
{
"expression": "resetAt",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.PlayTime": {
"name": "PlayTime",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"startTime": {
"name": "startTime",
"type": "text",
"primaryKey": false,
"notNull": false
},
"endTime": {
"name": "endTime",
"type": "text",
"primaryKey": false,
"notNull": false
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.RequestTime": {
"name": "RequestTime",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp(6)",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp(6)",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"startTime": {
"name": "startTime",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"endTime": {
"name": "endTime",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"expected": {
"name": "expected",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": 0
},
"accepted": {
"name": "accepted",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": 0
},
"past": {
"name": "past",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.ScheduleSongPool": {
"name": "ScheduleSongPool",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"songId": {
"name": "songId",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"addedBy": {
"name": "addedBy",
"type": "integer",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"ScheduleSongPool_songId_Song_id_fk": {
"name": "ScheduleSongPool_songId_Song_id_fk",
"tableFrom": "ScheduleSongPool",
"tableTo": "Song",
"columnsFrom": [
"songId"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"ScheduleSongPool_addedBy_User_id_fk": {
"name": "ScheduleSongPool_addedBy_User_id_fk",
"tableFrom": "ScheduleSongPool",
"tableTo": "User",
"columnsFrom": [
"addedBy"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"schedule_song_pool_song_unique": {
"name": "schedule_song_pool_song_unique",
"nullsNotDistinct": false,
"columns": [
"songId"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.Schedule": {
"name": "Schedule",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"songId": {
"name": "songId",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"playDate": {
"name": "playDate",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"played": {
"name": "played",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"sequence": {
"name": "sequence",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 1
},
"playTimeId": {
"name": "playTimeId",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"isDraft": {
"name": "isDraft",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"publishedAt": {
"name": "publishedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"replay_request_id": {
"name": "replay_request_id",
"type": "integer",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"schedule_published_song_idx": {
"name": "schedule_published_song_idx",
"columns": [
{
"expression": "isDraft",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "songId",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "playDate",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"schedule_published_date_idx": {
"name": "schedule_published_date_idx",
"columns": [
{
"expression": "isDraft",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "playDate",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.Semester": {
"name": "Semester",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"isActive": {
"name": "isActive",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.SongBlacklist": {
"name": "SongBlacklist",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"type": {
"name": "type",
"type": "BlacklistType",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"value": {
"name": "value",
"type": "text",
"primaryKey": false,
"notNull": true
},
"reason": {
"name": "reason",
"type": "text",
"primaryKey": false,
"notNull": false
},
"isActive": {
"name": "isActive",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"createdBy": {
"name": "createdBy",
"type": "integer",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.song_collaborators": {
"name": "song_collaborators",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"song_id": {
"name": "song_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "collaborator_status",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'PENDING'"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"song_collaborators_song_status_idx": {
"name": "song_collaborators_song_status_idx",
"columns": [
{
"expression": "song_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "status",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"song_collaborators_user_status_idx": {
"name": "song_collaborators_user_status_idx",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "status",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.song_replay_requests": {
"name": "song_replay_requests",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"song_id": {
"name": "song_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"status": {
"name": "status",
"type": "replay_request_status",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'PENDING'"
},
"preferred_play_time_id": {
"name": "preferred_play_time_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"submission_note": {
"name": "submission_note",
"type": "text",
"primaryKey": false,
"notNull": false
},
"submission_note_public": {
"name": "submission_note_public",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
}
},
"indexes": {
"song_replay_requests_pending_song_user_unique": {
"name": "song_replay_requests_pending_song_user_unique",
"columns": [
{
"expression": "song_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
"where": "\"song_replay_requests\".\"status\" = 'PENDING'",
"concurrently": false,
"method": "btree",
"with": {}
},
"song_replay_requests_user_status_song_idx": {
"name": "song_replay_requests_user_status_song_idx",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "status",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "song_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.Song": {
"name": "Song",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
"artist": {
"name": "artist",
"type": "text",
"primaryKey": false,
"notNull": true
},
"requesterId": {
"name": "requesterId",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"played": {
"name": "played",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"playedAt": {
"name": "playedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"semester": {
"name": "semester",
"type": "text",
"primaryKey": false,
"notNull": false
},
"preferredPlayTimeId": {
"name": "preferredPlayTimeId",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"cover": {
"name": "cover",
"type": "text",
"primaryKey": false,
"notNull": false
},
"playUrl": {
"name": "playUrl",
"type": "text",
"primaryKey": false,
"notNull": false
},
"musicPlatform": {
"name": "musicPlatform",
"type": "text",
"primaryKey": false,
"notNull": false
},
"musicId": {
"name": "musicId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"durationSeconds": {
"name": "durationSeconds",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"submissionNote": {
"name": "submissionNote",
"type": "text",
"primaryKey": false,
"notNull": false
},
"submissionNotePublic": {
"name": "submissionNotePublic",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"hitRequestId": {
"name": "hitRequestId",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"cardCodeId": {
"name": "cardCodeId",
"type": "integer",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"song_card_code_id_idx": {
"name": "song_card_code_id_idx",
"columns": [
{
"expression": "cardCodeId",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"song_semester_created_at_idx": {
"name": "song_semester_created_at_idx",
"columns": [
{
"expression": "semester",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "createdAt",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"song_requester_id_idx": {
"name": "song_requester_id_idx",
"columns": [
{
"expression": "requesterId",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"Song_cardCodeId_CardCode_id_fk": {
"name": "Song_cardCodeId_CardCode_id_fk",
"tableFrom": "Song",
"tableTo": "CardCode",
"columnsFrom": [
"cardCodeId"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.SystemSettings": {
"name": "SystemSettings",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"instance_id": {
"name": "instance_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"telemetryEnabled": {
"name": "telemetryEnabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"enablePlayTimeSelection": {
"name": "enablePlayTimeSelection",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"siteTitle": {
"name": "siteTitle",
"type": "text",
"primaryKey": false,
"notNull": false
},
"siteLogoUrl": {
"name": "siteLogoUrl",
"type": "text",
"primaryKey": false,
"notNull": false
},
"schoolLogoHomeUrl": {
"name": "schoolLogoHomeUrl",
"type": "text",
"primaryKey": false,
"notNull": false
},
"schoolLogoPrintUrl": {
"name": "schoolLogoPrintUrl",
"type": "text",
"primaryKey": false,
"notNull": false
},
"siteDescription": {
"name": "siteDescription",
"type": "text",
"primaryKey": false,
"notNull": false
},
"submissionGuidelines": {
"name": "submissionGuidelines",
"type": "text",
"primaryKey": false,
"notNull": false
},
"icpNumber": {
"name": "icpNumber",
"type": "text",
"primaryKey": false,
"notNull": false
},
"gonganNumber": {
"name": "gonganNumber",
"type": "text",
"primaryKey": false,
"notNull": false
},
"showBeianIcon": {
"name": "showBeianIcon",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"enableSubmissionLimit": {
"name": "enableSubmissionLimit",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"dailySubmissionLimit": {
"name": "dailySubmissionLimit",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"weeklySubmissionLimit": {
"name": "weeklySubmissionLimit",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"monthlySubmissionLimit": {
"name": "monthlySubmissionLimit",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"showBlacklistKeywords": {
"name": "showBlacklistKeywords",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"hideStudentInfo": {
"name": "hideStudentInfo",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"smtpEnabled": {
"name": "smtpEnabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"smtpHost": {
"name": "smtpHost",
"type": "text",
"primaryKey": false,
"notNull": false
},
"smtpPort": {
"name": "smtpPort",
"type": "integer",
"primaryKey": false,
"notNull": false,
"default": 587
},
"smtpSecure": {
"name": "smtpSecure",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"smtpUsername": {
"name": "smtpUsername",
"type": "text",
"primaryKey": false,
"notNull": false
},
"smtpPassword": {
"name": "smtpPassword",
"type": "text",
"primaryKey": false,
"notNull": false
},
"smtpFromEmail": {
"name": "smtpFromEmail",
"type": "text",
"primaryKey": false,
"notNull": false
},
"smtpFromName": {
"name": "smtpFromName",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'校园广播站'"
},
"enableRequestTimeLimitation": {
"name": "enableRequestTimeLimitation",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"forceBlockAllRequests": {
"name": "forceBlockAllRequests",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"forcePasswordChangeOnFirstLogin": {
"name": "forcePasswordChangeOnFirstLogin",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"enableReplayRequests": {
"name": "enableReplayRequests",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"enableCollaborativeSubmission": {
"name": "enableCollaborativeSubmission",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"enableSubmissionRemarks": {
"name": "enableSubmissionRemarks",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"enableCardCodeRequests": {
"name": "enableCardCodeRequests",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"requireCardCodeForRequests": {
"name": "requireCardCodeForRequests",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"enableCardCodeLimitBypass": {
"name": "enableCardCodeLimitBypass",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"enableSubmissionRestriction": {
"name": "enableSubmissionRestriction",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"submissionRestrictionScope": {
"name": "submissionRestrictionScope",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'all'"
},
"sameSongRestrictionHours": {
"name": "sameSongRestrictionHours",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"sameArtistRestrictionHours": {
"name": "sameArtistRestrictionHours",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"captchaProvider": {
"name": "captchaProvider",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'graphic'"
},
"turnstileSiteKey": {
"name": "turnstileSiteKey",
"type": "text",
"primaryKey": false,
"notNull": false
},
"turnstileSecretKey": {
"name": "turnstileSecretKey",
"type": "text",
"primaryKey": false,
"notNull": false
},
"allowOAuthRegistration": {
"name": "allowOAuthRegistration",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"oauthRedirectUri": {
"name": "oauthRedirectUri",
"type": "text",
"primaryKey": false,
"notNull": false
},
"oauthStateSecret": {
"name": "oauthStateSecret",
"type": "text",
"primaryKey": false,
"notNull": false
},
"oauthProviders": {
"name": "oauthProviders",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'[]'"
},
"githubOAuthEnabled": {
"name": "githubOAuthEnabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"githubClientId": {
"name": "githubClientId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"githubClientSecret": {
"name": "githubClientSecret",
"type": "text",
"primaryKey": false,
"notNull": false
},
"casdoorOAuthEnabled": {
"name": "casdoorOAuthEnabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"casdoorServerUrl": {
"name": "casdoorServerUrl",
"type": "text",
"primaryKey": false,
"notNull": false
},
"casdoorClientId": {
"name": "casdoorClientId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"casdoorClientSecret": {
"name": "casdoorClientSecret",
"type": "text",
"primaryKey": false,
"notNull": false
},
"casdoorOrganizationName": {
"name": "casdoorOrganizationName",
"type": "text",
"primaryKey": false,
"notNull": false
},
"googleOAuthEnabled": {
"name": "googleOAuthEnabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"googleClientId": {
"name": "googleClientId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"googleClientSecret": {
"name": "googleClientSecret",
"type": "text",
"primaryKey": false,
"notNull": false
},
"aggregateOAuthEnabled": {
"name": "aggregateOAuthEnabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"aggregateOAuthAppId": {
"name": "aggregateOAuthAppId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"aggregateOAuthAppKey": {
"name": "aggregateOAuthAppKey",
"type": "text",
"primaryKey": false,
"notNull": false
},
"aggregateOAuthLoginType": {
"name": "aggregateOAuthLoginType",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'qq'"
},
"aggregateOAuthEndpoint": {
"name": "aggregateOAuthEndpoint",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'https://a.idcfx.net/connect.php'"
},
"customOAuthEnabled": {
"name": "customOAuthEnabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"customOAuthDisplayName": {
"name": "customOAuthDisplayName",
"type": "text",
"primaryKey": false,
"notNull": false
},
"customOAuthAuthorizeUrl": {
"name": "customOAuthAuthorizeUrl",
"type": "text",
"primaryKey": false,
"notNull": false
},
"customOAuthTokenUrl": {
"name": "customOAuthTokenUrl",
"type": "text",
"primaryKey": false,
"notNull": false
},
"customOAuthUserInfoUrl": {
"name": "customOAuthUserInfoUrl",
"type": "text",
"primaryKey": false,
"notNull": false
},
"customOAuthScope": {
"name": "customOAuthScope",
"type": "text",
"primaryKey": false,
"notNull": false
},
"customOAuthClientId": {
"name": "customOAuthClientId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"customOAuthClientSecret": {
"name": "customOAuthClientSecret",
"type": "text",
"primaryKey": false,
"notNull": false
},
"customOAuthUserIdField": {
"name": "customOAuthUserIdField",
"type": "text",
"primaryKey": false,
"notNull": false
},
"customOAuthUsernameField": {
"name": "customOAuthUsernameField",
"type": "text",
"primaryKey": false,
"notNull": false
},
"customOAuthNameField": {
"name": "customOAuthNameField",
"type": "text",
"primaryKey": false,
"notNull": false
},
"customOAuthEmailField": {
"name": "customOAuthEmailField",
"type": "text",
"primaryKey": false,
"notNull": false
},
"customOAuthAvatarField": {
"name": "customOAuthAvatarField",
"type": "text",
"primaryKey": false,
"notNull": false
},
"captchaEnabled": {
"name": "captchaEnabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"captchaMaxFailures": {
"name": "captchaMaxFailures",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 3
},
"autoBackupEnabled": {
"name": "autoBackupEnabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"autoBackupConfig": {
"name": "autoBackupConfig",
"type": "text",
"primaryKey": false,
"notNull": false
},
"enabledPlatforms": {
"name": "enabledPlatforms",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'[\"netease\",\"tencent\",\"bilibili\",\"migu\"]'"
},
"platformOrder": {
"name": "platformOrder",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'[\"netease\",\"tencent\",\"bilibili\",\"migu\"]'"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.UserIdentity": {
"name": "UserIdentity",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"userId": {
"name": "userId",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"provider": {
"name": "provider",
"type": "text",
"primaryKey": false,
"notNull": true
},
"providerUserId": {
"name": "providerUserId",
"type": "text",
"primaryKey": false,
"notNull": true
},
"providerUsername": {
"name": "providerUsername",
"type": "text",
"primaryKey": false,
"notNull": false
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"UserIdentity_userId_User_id_fk": {
"name": "UserIdentity_userId_User_id_fk",
"tableFrom": "UserIdentity",
"tableTo": "User",
"columnsFrom": [
"userId"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"UserIdentity_provider_providerUserId_unique": {
"name": "UserIdentity_provider_providerUserId_unique",
"nullsNotDistinct": false,
"columns": [
"provider",
"providerUserId"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.user_status_logs": {
"name": "user_status_logs",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"old_status": {
"name": "old_status",
"type": "user_status",
"typeSchema": "public",
"primaryKey": false,
"notNull": false
},
"new_status": {
"name": "new_status",
"type": "user_status",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"reason": {
"name": "reason",
"type": "text",
"primaryKey": false,
"notNull": false
},
"operator_id": {
"name": "operator_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.User": {
"name": "User",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"username": {
"name": "username",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"grade": {
"name": "grade",
"type": "text",
"primaryKey": false,
"notNull": false
},
"class": {
"name": "class",
"type": "text",
"primaryKey": false,
"notNull": false
},
"role": {
"name": "role",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'USER'"
},
"password": {
"name": "password",
"type": "text",
"primaryKey": false,
"notNull": true
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": false
},
"emailVerified": {
"name": "emailVerified",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"lastLogin": {
"name": "lastLogin",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"lastLoginIp": {
"name": "lastLoginIp",
"type": "text",
"primaryKey": false,
"notNull": false
},
"passwordChangedAt": {
"name": "passwordChangedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"forcePasswordChange": {
"name": "forcePasswordChange",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"tokenVersion": {
"name": "tokenVersion",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"meowNickname": {
"name": "meowNickname",
"type": "text",
"primaryKey": false,
"notNull": false
},
"meowBoundAt": {
"name": "meowBoundAt",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "user_status",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'active'"
},
"statusChangedAt": {
"name": "statusChangedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"statusChangedBy": {
"name": "statusChangedBy",
"type": "integer",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.Vote": {
"name": "Vote",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"songId": {
"name": "songId",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"userId": {
"name": "userId",
"type": "integer",
"primaryKey": false,
"notNull": true
}
},
"indexes": {
"vote_user_song_idx": {
"name": "vote_user_song_idx",
"columns": [
{
"expression": "userId",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "songId",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"vote_song_user_unique": {
"name": "vote_song_user_unique",
"nullsNotDistinct": false,
"columns": [
"songId",
"userId"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {
"public.BlacklistType": {
"name": "BlacklistType",
"schema": "public",
"values": [
"SONG",
"KEYWORD"
]
},
"public.card_code_status": {
"name": "card_code_status",
"schema": "public",
"values": [
"AVAILABLE",
"LOCKED",
"REDEEMED",
"INVALID"
]
},
"public.collaborator_status": {
"name": "collaborator_status",
"schema": "public",
"values": [
"PENDING",
"ACCEPTED",
"REJECTED"
]
},
"public.replay_request_status": {
"name": "replay_request_status",
"schema": "public",
"values": [
"PENDING",
"FULFILLED",
"REJECTED"
]
},
"public.user_status": {
"name": "user_status",
"schema": "public",
"values": [
"active",
"withdrawn",
"graduate"
]
}
},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}