- migrate from SQLite to PostgreSQL with Drizzle ORM - implement comprehensive AdminLayout with expandable sidebar navigation - create professional dashboard with real-time charts and metrics - add advanced monitoring, reporting, and export functionality - fix menu alignment and remove non-existent pages - eliminate duplicate headers and improve UI consistency - add Tailwind CSS v3 for professional styling - expand database schema from 6 to 15 tables - implement role-based access control and API key management - create comprehensive settings, monitoring, and system info pages
2330 lines
58 KiB
JSON
2330 lines
58 KiB
JSON
{
|
|
"id": "32ffceee-f303-4ee0-b59e-e23e1a009480",
|
|
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
"version": "7",
|
|
"dialect": "postgresql",
|
|
"tables": {
|
|
"public.analytics_events": {
|
|
"name": "analytics_events",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "serial",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"event_type": {
|
|
"name": "event_type",
|
|
"type": "varchar(50)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"source_url": {
|
|
"name": "source_url",
|
|
"type": "varchar(1000)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"source_id": {
|
|
"name": "source_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"api_key_id": {
|
|
"name": "api_key_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"ip_address": {
|
|
"name": "ip_address",
|
|
"type": "varchar(45)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"user_agent": {
|
|
"name": "user_agent",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"response_time": {
|
|
"name": "response_time",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"status_code": {
|
|
"name": "status_code",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"metadata": {
|
|
"name": "metadata",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'{}'"
|
|
},
|
|
"timestamp": {
|
|
"name": "timestamp",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_analytics_events_type": {
|
|
"name": "idx_analytics_events_type",
|
|
"columns": [
|
|
{
|
|
"expression": "event_type",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_analytics_events_timestamp": {
|
|
"name": "idx_analytics_events_timestamp",
|
|
"columns": [
|
|
{
|
|
"expression": "timestamp",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_analytics_events_source_id": {
|
|
"name": "idx_analytics_events_source_id",
|
|
"columns": [
|
|
{
|
|
"expression": "source_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_analytics_events_api_key_id": {
|
|
"name": "idx_analytics_events_api_key_id",
|
|
"columns": [
|
|
{
|
|
"expression": "api_key_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_analytics_events_ip": {
|
|
"name": "idx_analytics_events_ip",
|
|
"columns": [
|
|
{
|
|
"expression": "ip_address",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"analytics_events_source_id_sources_id_fk": {
|
|
"name": "analytics_events_source_id_sources_id_fk",
|
|
"tableFrom": "analytics_events",
|
|
"tableTo": "sources",
|
|
"columnsFrom": [
|
|
"source_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"analytics_events_user_id_users_id_fk": {
|
|
"name": "analytics_events_user_id_users_id_fk",
|
|
"tableFrom": "analytics_events",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"analytics_events_api_key_id_api_keys_id_fk": {
|
|
"name": "analytics_events_api_key_id_api_keys_id_fk",
|
|
"tableFrom": "analytics_events",
|
|
"tableTo": "api_keys",
|
|
"columnsFrom": [
|
|
"api_key_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.api_keys": {
|
|
"name": "api_keys",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "serial",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"key_hash": {
|
|
"name": "key_hash",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "varchar(100)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"description": {
|
|
"name": "description",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"owner_email": {
|
|
"name": "owner_email",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"permissions": {
|
|
"name": "permissions",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'[\"read\"]'"
|
|
},
|
|
"rate_limit": {
|
|
"name": "rate_limit",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": 1000
|
|
},
|
|
"is_active": {
|
|
"name": "is_active",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": true
|
|
},
|
|
"usage_count": {
|
|
"name": "usage_count",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": 0
|
|
},
|
|
"last_used": {
|
|
"name": "last_used",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"expires_at": {
|
|
"name": "expires_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_api_keys_hash": {
|
|
"name": "idx_api_keys_hash",
|
|
"columns": [
|
|
{
|
|
"expression": "key_hash",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_api_keys_owner": {
|
|
"name": "idx_api_keys_owner",
|
|
"columns": [
|
|
{
|
|
"expression": "owner_email",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"api_keys_key_hash_unique": {
|
|
"name": "api_keys_key_hash_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"key_hash"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.audit_logs": {
|
|
"name": "audit_logs",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "serial",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"action": {
|
|
"name": "action",
|
|
"type": "varchar(50)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"resource_type": {
|
|
"name": "resource_type",
|
|
"type": "varchar(50)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"resource_id": {
|
|
"name": "resource_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"details": {
|
|
"name": "details",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"ip_address": {
|
|
"name": "ip_address",
|
|
"type": "varchar(45)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_audit_logs_user_id": {
|
|
"name": "idx_audit_logs_user_id",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_audit_logs_created_at": {
|
|
"name": "idx_audit_logs_created_at",
|
|
"columns": [
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_audit_logs_action": {
|
|
"name": "idx_audit_logs_action",
|
|
"columns": [
|
|
{
|
|
"expression": "action",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_audit_logs_resource_type": {
|
|
"name": "idx_audit_logs_resource_type",
|
|
"columns": [
|
|
{
|
|
"expression": "resource_type",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"audit_logs_user_id_users_id_fk": {
|
|
"name": "audit_logs_user_id_users_id_fk",
|
|
"tableFrom": "audit_logs",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"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": "varchar(100)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"slug": {
|
|
"name": "slug",
|
|
"type": "varchar(100)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"description": {
|
|
"name": "description",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"color": {
|
|
"name": "color",
|
|
"type": "varchar(7)",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'#6B7280'"
|
|
},
|
|
"priority": {
|
|
"name": "priority",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": 1
|
|
},
|
|
"icon": {
|
|
"name": "icon",
|
|
"type": "varchar(50)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"is_active": {
|
|
"name": "is_active",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_categories_slug": {
|
|
"name": "idx_categories_slug",
|
|
"columns": [
|
|
{
|
|
"expression": "slug",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_categories_priority": {
|
|
"name": "idx_categories_priority",
|
|
"columns": [
|
|
{
|
|
"expression": "priority",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"categories_name_unique": {
|
|
"name": "categories_name_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"name"
|
|
]
|
|
},
|
|
"categories_slug_unique": {
|
|
"name": "categories_slug_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"slug"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.email_templates": {
|
|
"name": "email_templates",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "serial",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "varchar(100)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"subject": {
|
|
"name": "subject",
|
|
"type": "varchar(200)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"html_body": {
|
|
"name": "html_body",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"text_body": {
|
|
"name": "text_body",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"variables": {
|
|
"name": "variables",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'[]'"
|
|
},
|
|
"is_active": {
|
|
"name": "is_active",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": true
|
|
},
|
|
"created_by": {
|
|
"name": "created_by",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_email_templates_name": {
|
|
"name": "idx_email_templates_name",
|
|
"columns": [
|
|
{
|
|
"expression": "name",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_email_templates_is_active": {
|
|
"name": "idx_email_templates_is_active",
|
|
"columns": [
|
|
{
|
|
"expression": "is_active",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"email_templates_created_by_users_id_fk": {
|
|
"name": "email_templates_created_by_users_id_fk",
|
|
"tableFrom": "email_templates",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"created_by"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"email_templates_name_unique": {
|
|
"name": "email_templates_name_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"name"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.notifications": {
|
|
"name": "notifications",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "serial",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"title": {
|
|
"name": "title",
|
|
"type": "varchar(200)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"message": {
|
|
"name": "message",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"type": {
|
|
"name": "type",
|
|
"type": "varchar(50)",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'info'"
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"is_read": {
|
|
"name": "is_read",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": false
|
|
},
|
|
"action_url": {
|
|
"name": "action_url",
|
|
"type": "varchar(500)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"metadata": {
|
|
"name": "metadata",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'{}'"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
},
|
|
"read_at": {
|
|
"name": "read_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_notifications_user_id": {
|
|
"name": "idx_notifications_user_id",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_notifications_is_read": {
|
|
"name": "idx_notifications_is_read",
|
|
"columns": [
|
|
{
|
|
"expression": "is_read",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_notifications_created_at": {
|
|
"name": "idx_notifications_created_at",
|
|
"columns": [
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_notifications_type": {
|
|
"name": "idx_notifications_type",
|
|
"columns": [
|
|
{
|
|
"expression": "type",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"notifications_user_id_users_id_fk": {
|
|
"name": "notifications_user_id_users_id_fk",
|
|
"tableFrom": "notifications",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.reports": {
|
|
"name": "reports",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "serial",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"source_url": {
|
|
"name": "source_url",
|
|
"type": "varchar(1000)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"source_domain": {
|
|
"name": "source_domain",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"reporter_email": {
|
|
"name": "reporter_email",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"reporter_name": {
|
|
"name": "reporter_name",
|
|
"type": "varchar(100)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"category_suggestions": {
|
|
"name": "category_suggestions",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"description": {
|
|
"name": "description",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"evidence_urls": {
|
|
"name": "evidence_urls",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"priority": {
|
|
"name": "priority",
|
|
"type": "priority",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'medium'"
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "report_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'pending'"
|
|
},
|
|
"assigned_to": {
|
|
"name": "assigned_to",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"admin_notes": {
|
|
"name": "admin_notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"processed_at": {
|
|
"name": "processed_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"ip_address": {
|
|
"name": "ip_address",
|
|
"type": "varchar(45)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"user_agent": {
|
|
"name": "user_agent",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_reports_status": {
|
|
"name": "idx_reports_status",
|
|
"columns": [
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_reports_source_domain": {
|
|
"name": "idx_reports_source_domain",
|
|
"columns": [
|
|
{
|
|
"expression": "source_domain",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_reports_priority": {
|
|
"name": "idx_reports_priority",
|
|
"columns": [
|
|
{
|
|
"expression": "priority",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_reports_created_at": {
|
|
"name": "idx_reports_created_at",
|
|
"columns": [
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_reports_assigned_to": {
|
|
"name": "idx_reports_assigned_to",
|
|
"columns": [
|
|
{
|
|
"expression": "assigned_to",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"reports_assigned_to_users_id_fk": {
|
|
"name": "reports_assigned_to_users_id_fk",
|
|
"tableFrom": "reports",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"assigned_to"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.scheduled_jobs": {
|
|
"name": "scheduled_jobs",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "serial",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "varchar(100)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"type": {
|
|
"name": "type",
|
|
"type": "varchar(50)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"schedule": {
|
|
"name": "schedule",
|
|
"type": "varchar(100)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"is_active": {
|
|
"name": "is_active",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": true
|
|
},
|
|
"last_run": {
|
|
"name": "last_run",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"next_run": {
|
|
"name": "next_run",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"last_result": {
|
|
"name": "last_result",
|
|
"type": "varchar(50)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"config": {
|
|
"name": "config",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'{}'"
|
|
},
|
|
"created_by": {
|
|
"name": "created_by",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_scheduled_jobs_name": {
|
|
"name": "idx_scheduled_jobs_name",
|
|
"columns": [
|
|
{
|
|
"expression": "name",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_scheduled_jobs_type": {
|
|
"name": "idx_scheduled_jobs_type",
|
|
"columns": [
|
|
{
|
|
"expression": "type",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_scheduled_jobs_next_run": {
|
|
"name": "idx_scheduled_jobs_next_run",
|
|
"columns": [
|
|
{
|
|
"expression": "next_run",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_scheduled_jobs_is_active": {
|
|
"name": "idx_scheduled_jobs_is_active",
|
|
"columns": [
|
|
{
|
|
"expression": "is_active",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"scheduled_jobs_created_by_users_id_fk": {
|
|
"name": "scheduled_jobs_created_by_users_id_fk",
|
|
"tableFrom": "scheduled_jobs",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"created_by"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.source_analytics": {
|
|
"name": "source_analytics",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "serial",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"source_id": {
|
|
"name": "source_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"date": {
|
|
"name": "date",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"lookup_count": {
|
|
"name": "lookup_count",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": 0
|
|
},
|
|
"report_count": {
|
|
"name": "report_count",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": 0
|
|
},
|
|
"view_count": {
|
|
"name": "view_count",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": 0
|
|
},
|
|
"risk_score": {
|
|
"name": "risk_score",
|
|
"type": "numeric(3, 2)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"metadata": {
|
|
"name": "metadata",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'{}'"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_source_analytics_source_id": {
|
|
"name": "idx_source_analytics_source_id",
|
|
"columns": [
|
|
{
|
|
"expression": "source_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_source_analytics_date": {
|
|
"name": "idx_source_analytics_date",
|
|
"columns": [
|
|
{
|
|
"expression": "date",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"unique_source_date": {
|
|
"name": "unique_source_date",
|
|
"columns": [
|
|
{
|
|
"expression": "source_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "date",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"source_analytics_source_id_sources_id_fk": {
|
|
"name": "source_analytics_source_id_sources_id_fk",
|
|
"tableFrom": "source_analytics",
|
|
"tableTo": "sources",
|
|
"columnsFrom": [
|
|
"source_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.source_categories": {
|
|
"name": "source_categories",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "serial",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"source_id": {
|
|
"name": "source_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"category_id": {
|
|
"name": "category_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"confidence_score": {
|
|
"name": "confidence_score",
|
|
"type": "numeric(3, 2)",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'1.0'"
|
|
},
|
|
"added_by": {
|
|
"name": "added_by",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_source_categories_source_id": {
|
|
"name": "idx_source_categories_source_id",
|
|
"columns": [
|
|
{
|
|
"expression": "source_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_source_categories_category_id": {
|
|
"name": "idx_source_categories_category_id",
|
|
"columns": [
|
|
{
|
|
"expression": "category_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"unique_source_category": {
|
|
"name": "unique_source_category",
|
|
"columns": [
|
|
{
|
|
"expression": "source_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "category_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"source_categories_source_id_sources_id_fk": {
|
|
"name": "source_categories_source_id_sources_id_fk",
|
|
"tableFrom": "source_categories",
|
|
"tableTo": "sources",
|
|
"columnsFrom": [
|
|
"source_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"source_categories_category_id_categories_id_fk": {
|
|
"name": "source_categories_category_id_categories_id_fk",
|
|
"tableFrom": "source_categories",
|
|
"tableTo": "categories",
|
|
"columnsFrom": [
|
|
"category_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"source_categories_added_by_users_id_fk": {
|
|
"name": "source_categories_added_by_users_id_fk",
|
|
"tableFrom": "source_categories",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"added_by"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.sources": {
|
|
"name": "sources",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "serial",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"url": {
|
|
"name": "url",
|
|
"type": "varchar(1000)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"domain": {
|
|
"name": "domain",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"title": {
|
|
"name": "title",
|
|
"type": "varchar(500)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"description": {
|
|
"name": "description",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"type": {
|
|
"name": "type",
|
|
"type": "source_type",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "source_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'pending'"
|
|
},
|
|
"risk_level": {
|
|
"name": "risk_level",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": 1
|
|
},
|
|
"language": {
|
|
"name": "language",
|
|
"type": "language",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'sk'"
|
|
},
|
|
"evidence_urls": {
|
|
"name": "evidence_urls",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"reported_by": {
|
|
"name": "reported_by",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"verified_by": {
|
|
"name": "verified_by",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"rejection_reason": {
|
|
"name": "rejection_reason",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"follower_count": {
|
|
"name": "follower_count",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": 0
|
|
},
|
|
"last_checked": {
|
|
"name": "last_checked",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"metadata": {
|
|
"name": "metadata",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'{}'"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_sources_domain": {
|
|
"name": "idx_sources_domain",
|
|
"columns": [
|
|
{
|
|
"expression": "domain",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_sources_status": {
|
|
"name": "idx_sources_status",
|
|
"columns": [
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_sources_risk_level": {
|
|
"name": "idx_sources_risk_level",
|
|
"columns": [
|
|
{
|
|
"expression": "risk_level",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_sources_type": {
|
|
"name": "idx_sources_type",
|
|
"columns": [
|
|
{
|
|
"expression": "type",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_sources_created_at": {
|
|
"name": "idx_sources_created_at",
|
|
"columns": [
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_sources_verified_by": {
|
|
"name": "idx_sources_verified_by",
|
|
"columns": [
|
|
{
|
|
"expression": "verified_by",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_sources_status_risk": {
|
|
"name": "idx_sources_status_risk",
|
|
"columns": [
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "risk_level",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"sources_verified_by_users_id_fk": {
|
|
"name": "sources_verified_by_users_id_fk",
|
|
"tableFrom": "sources",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"verified_by"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"sources_url_unique": {
|
|
"name": "sources_url_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"url"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.system_metrics": {
|
|
"name": "system_metrics",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "serial",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"metric_type": {
|
|
"name": "metric_type",
|
|
"type": "varchar(50)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"value": {
|
|
"name": "value",
|
|
"type": "numeric(10, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"unit": {
|
|
"name": "unit",
|
|
"type": "varchar(20)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"timestamp": {
|
|
"name": "timestamp",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_system_metrics_type": {
|
|
"name": "idx_system_metrics_type",
|
|
"columns": [
|
|
{
|
|
"expression": "metric_type",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_system_metrics_timestamp": {
|
|
"name": "idx_system_metrics_timestamp",
|
|
"columns": [
|
|
{
|
|
"expression": "timestamp",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_system_metrics_type_timestamp": {
|
|
"name": "idx_system_metrics_type_timestamp",
|
|
"columns": [
|
|
{
|
|
"expression": "metric_type",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "timestamp",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.system_settings": {
|
|
"name": "system_settings",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "serial",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"key": {
|
|
"name": "key",
|
|
"type": "varchar(100)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"value": {
|
|
"name": "value",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"type": {
|
|
"name": "type",
|
|
"type": "varchar(50)",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'string'"
|
|
},
|
|
"description": {
|
|
"name": "description",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"category": {
|
|
"name": "category",
|
|
"type": "varchar(50)",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'general'"
|
|
},
|
|
"is_public": {
|
|
"name": "is_public",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": false
|
|
},
|
|
"updated_by": {
|
|
"name": "updated_by",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_system_settings_key": {
|
|
"name": "idx_system_settings_key",
|
|
"columns": [
|
|
{
|
|
"expression": "key",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_system_settings_category": {
|
|
"name": "idx_system_settings_category",
|
|
"columns": [
|
|
{
|
|
"expression": "category",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"system_settings_updated_by_users_id_fk": {
|
|
"name": "system_settings_updated_by_users_id_fk",
|
|
"tableFrom": "system_settings",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"updated_by"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"system_settings_key_unique": {
|
|
"name": "system_settings_key_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"key"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.users": {
|
|
"name": "users",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "serial",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"password_hash": {
|
|
"name": "password_hash",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "varchar(100)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"role": {
|
|
"name": "role",
|
|
"type": "role",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'moderator'"
|
|
},
|
|
"is_active": {
|
|
"name": "is_active",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": true
|
|
},
|
|
"last_login": {
|
|
"name": "last_login",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"users_email_unique": {
|
|
"name": "users_email_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"email"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.webhooks": {
|
|
"name": "webhooks",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "serial",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "varchar(100)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"url": {
|
|
"name": "url",
|
|
"type": "varchar(1000)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"events": {
|
|
"name": "events",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"secret": {
|
|
"name": "secret",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"is_active": {
|
|
"name": "is_active",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": true
|
|
},
|
|
"headers": {
|
|
"name": "headers",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'{}'"
|
|
},
|
|
"last_triggered": {
|
|
"name": "last_triggered",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"success_count": {
|
|
"name": "success_count",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": 0
|
|
},
|
|
"failure_count": {
|
|
"name": "failure_count",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": 0
|
|
},
|
|
"created_by": {
|
|
"name": "created_by",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_webhooks_created_by": {
|
|
"name": "idx_webhooks_created_by",
|
|
"columns": [
|
|
{
|
|
"expression": "created_by",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_webhooks_is_active": {
|
|
"name": "idx_webhooks_is_active",
|
|
"columns": [
|
|
{
|
|
"expression": "is_active",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"webhooks_created_by_users_id_fk": {
|
|
"name": "webhooks_created_by_users_id_fk",
|
|
"tableFrom": "webhooks",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"created_by"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
}
|
|
},
|
|
"enums": {
|
|
"public.language": {
|
|
"name": "language",
|
|
"schema": "public",
|
|
"values": [
|
|
"sk",
|
|
"cs",
|
|
"en",
|
|
"other"
|
|
]
|
|
},
|
|
"public.priority": {
|
|
"name": "priority",
|
|
"schema": "public",
|
|
"values": [
|
|
"low",
|
|
"medium",
|
|
"high",
|
|
"urgent"
|
|
]
|
|
},
|
|
"public.report_status": {
|
|
"name": "report_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"pending",
|
|
"in_review",
|
|
"approved",
|
|
"rejected",
|
|
"duplicate"
|
|
]
|
|
},
|
|
"public.role": {
|
|
"name": "role",
|
|
"schema": "public",
|
|
"values": [
|
|
"admin",
|
|
"moderator"
|
|
]
|
|
},
|
|
"public.source_status": {
|
|
"name": "source_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"pending",
|
|
"verified",
|
|
"rejected",
|
|
"under_review"
|
|
]
|
|
},
|
|
"public.source_type": {
|
|
"name": "source_type",
|
|
"schema": "public",
|
|
"values": [
|
|
"website",
|
|
"facebook_page",
|
|
"facebook_group",
|
|
"instagram",
|
|
"blog",
|
|
"news_site",
|
|
"youtube",
|
|
"tiktok",
|
|
"telegram",
|
|
"other"
|
|
]
|
|
}
|
|
},
|
|
"schemas": {},
|
|
"sequences": {},
|
|
"roles": {},
|
|
"policies": {},
|
|
"views": {},
|
|
"_meta": {
|
|
"columns": {},
|
|
"schemas": {},
|
|
"tables": {}
|
|
}
|
|
} |