{ "id": "ca73d698-19da-458a-b07d-887f32f581d4", "prevId": "d782a269-0b75-41b0-b70e-e3bf214f4f80", "version": "7", "dialect": "postgresql", "tables": { "public.settings": { "name": "settings", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "storage": { "name": "storage", "type": "type_storage", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'local'" }, "name": { "name": "name", "type": "varchar(255)", "primaryKey": false, "notNull": true }, "s3_endpoint_url": { "name": "s3_endpoint_url", "type": "varchar(255)", "primaryKey": false, "notNull": false }, "s3_access_key_id": { "name": "s3_access_key_id", "type": "varchar(255)", "primaryKey": false, "notNull": false }, "s3_secret_access_key": { "name": "s3_secret_access_key", "type": "varchar(255)", "primaryKey": false, "notNull": false }, "s3_bucket_name": { "name": "s3_bucket_name", "type": "varchar(255)", "primaryKey": false, "notNull": false }, "smtp_password": { "name": "smtp_password", "type": "varchar(255)", "primaryKey": false, "notNull": false }, "smtp_from": { "name": "smtp_from", "type": "varchar(255)", "primaryKey": false, "notNull": false }, "smtp_host": { "name": "smtp_host", "type": "varchar(255)", "primaryKey": false, "notNull": false }, "smtp_port": { "name": "smtp_port", "type": "varchar(255)", "primaryKey": false, "notNull": false }, "smtp_user": { "name": "smtp_user", "type": "varchar(255)", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { "settings_name_unique": { "name": "settings_name_unique", "nullsNotDistinct": false, "columns": [ "name" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.account": { "name": "account", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "account_id": { "name": "account_id", "type": "text", "primaryKey": false, "notNull": true }, "provider_id": { "name": "provider_id", "type": "text", "primaryKey": false, "notNull": true }, "user_id": { "name": "user_id", "type": "uuid", "primaryKey": false, "notNull": true }, "access_token": { "name": "access_token", "type": "text", "primaryKey": false, "notNull": false }, "refresh_token": { "name": "refresh_token", "type": "text", "primaryKey": false, "notNull": false }, "id_token": { "name": "id_token", "type": "text", "primaryKey": false, "notNull": false }, "access_token_expires_at": { "name": "access_token_expires_at", "type": "timestamp", "primaryKey": false, "notNull": false }, "refresh_token_expires_at": { "name": "refresh_token_expires_at", "type": "timestamp", "primaryKey": false, "notNull": false }, "scope": { "name": "scope", "type": "text", "primaryKey": false, "notNull": false }, "password": { "name": "password", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "account_user_id_user_id_fk": { "name": "account_user_id_user_id_fk", "tableFrom": "account", "tableTo": "user", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.session": { "name": "session", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "expires_at": { "name": "expires_at", "type": "timestamp", "primaryKey": false, "notNull": true }, "token": { "name": "token", "type": "text", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": false }, "ip_address": { "name": "ip_address", "type": "text", "primaryKey": false, "notNull": false }, "user_agent": { "name": "user_agent", "type": "text", "primaryKey": false, "notNull": false }, "user_id": { "name": "user_id", "type": "uuid", "primaryKey": false, "notNull": true }, "impersonated_by": { "name": "impersonated_by", "type": "text", "primaryKey": false, "notNull": false }, "active_organization_id": { "name": "active_organization_id", "type": "text", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "session_user_id_user_id_fk": { "name": "session_user_id_user_id_fk", "tableFrom": "session", "tableTo": "user", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "session_token_unique": { "name": "session_token_unique", "nullsNotDistinct": false, "columns": [ "token" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.user": { "name": "user", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true }, "email": { "name": "email", "type": "text", "primaryKey": false, "notNull": true }, "email_verified": { "name": "email_verified", "type": "boolean", "primaryKey": false, "notNull": true }, "image": { "name": "image", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": false }, "role": { "name": "role", "type": "text", "primaryKey": false, "notNull": false }, "banned": { "name": "banned", "type": "boolean", "primaryKey": false, "notNull": false }, "ban_reason": { "name": "ban_reason", "type": "text", "primaryKey": false, "notNull": false }, "ban_expires": { "name": "ban_expires", "type": "timestamp", "primaryKey": false, "notNull": false }, "deleted_at": { "name": "deleted_at", "type": "timestamp", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { "user_email_unique": { "name": "user_email_unique", "nullsNotDistinct": false, "columns": [ "email" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.verification": { "name": "verification", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "identifier": { "name": "identifier", "type": "text", "primaryKey": false, "notNull": true }, "value": { "name": "value", "type": "text", "primaryKey": false, "notNull": true }, "expires_at": { "name": "expires_at", "type": "timestamp", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.organization": { "name": "organization", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true }, "slug": { "name": "slug", "type": "text", "primaryKey": false, "notNull": true }, "logo": { "name": "logo", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": false }, "metadata": { "name": "metadata", "type": "text", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { "organization_slug_unique": { "name": "organization_slug_unique", "nullsNotDistinct": false, "columns": [ "slug" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.member": { "name": "member", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "organization_id": { "name": "organization_id", "type": "uuid", "primaryKey": false, "notNull": true }, "user_id": { "name": "user_id", "type": "uuid", "primaryKey": false, "notNull": true }, "role": { "name": "role", "type": "text", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "member_organization_id_organization_id_fk": { "name": "member_organization_id_organization_id_fk", "tableFrom": "member", "tableTo": "organization", "columnsFrom": [ "organization_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "member_user_id_user_id_fk": { "name": "member_user_id_user_id_fk", "tableFrom": "member", "tableTo": "user", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.invitation": { "name": "invitation", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "organization_id": { "name": "organization_id", "type": "uuid", "primaryKey": false, "notNull": true }, "email": { "name": "email", "type": "text", "primaryKey": false, "notNull": true }, "role": { "name": "role", "type": "text", "primaryKey": false, "notNull": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true }, "expires_at": { "name": "expires_at", "type": "timestamp", "primaryKey": false, "notNull": true }, "inviter_id": { "name": "inviter_id", "type": "uuid", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": { "invitation_organization_id_organization_id_fk": { "name": "invitation_organization_id_organization_id_fk", "tableFrom": "invitation", "tableTo": "organization", "columnsFrom": [ "organization_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "invitation_inviter_id_user_id_fk": { "name": "invitation_inviter_id_user_id_fk", "tableFrom": "invitation", "tableTo": "user", "columnsFrom": [ "inviter_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.projects": { "name": "projects", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "slug": { "name": "slug", "type": "text", "primaryKey": false, "notNull": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true }, "is_archived": { "name": "is_archived", "type": "boolean", "primaryKey": false, "notNull": false, "default": false }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": false }, "organization_id": { "name": "organization_id", "type": "uuid", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": { "projects_organization_id_organization_id_fk": { "name": "projects_organization_id_organization_id_fk", "tableFrom": "projects", "tableTo": "organization", "columnsFrom": [ "organization_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "projects_slug_unique": { "name": "projects_slug_unique", "nullsNotDistinct": false, "columns": [ "slug" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.backups": { "name": "backups", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "status": { "name": "status", "type": "status", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'waiting'" }, "file": { "name": "file", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": false }, "database_id": { "name": "database_id", "type": "uuid", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": { "backups_database_id_databases_id_fk": { "name": "backups_database_id_databases_id_fk", "tableFrom": "backups", "tableTo": "databases", "columnsFrom": [ "database_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.databases": { "name": "databases", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "agent_database_id": { "name": "agent_database_id", "type": "uuid", "primaryKey": false, "notNull": true, "default": "gen_random_uuid()" }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true }, "dbms": { "name": "dbms", "type": "dbms_status", "typeSchema": "public", "primaryKey": false, "notNull": true }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": false }, "backup_policy": { "name": "backup_policy", "type": "text", "primaryKey": false, "notNull": false }, "is_waiting_for_backup": { "name": "is_waiting_for_backup", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "backup_to_restore": { "name": "backup_to_restore", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": false }, "agent_id": { "name": "agent_id", "type": "uuid", "primaryKey": false, "notNull": true }, "last_contact": { "name": "last_contact", "type": "timestamp", "primaryKey": false, "notNull": false }, "project_id": { "name": "project_id", "type": "uuid", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "databases_agent_id_agents_id_fk": { "name": "databases_agent_id_agents_id_fk", "tableFrom": "databases", "tableTo": "agents", "columnsFrom": [ "agent_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "databases_project_id_projects_id_fk": { "name": "databases_project_id_projects_id_fk", "tableFrom": "databases", "tableTo": "projects", "columnsFrom": [ "project_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.restorations": { "name": "restorations", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "status": { "name": "status", "type": "status", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'waiting'" }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": false }, "backup_id": { "name": "backup_id", "type": "uuid", "primaryKey": false, "notNull": true }, "database_id": { "name": "database_id", "type": "uuid", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "restorations_backup_id_backups_id_fk": { "name": "restorations_backup_id_backups_id_fk", "tableFrom": "restorations", "tableTo": "backups", "columnsFrom": [ "backup_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "restorations_database_id_databases_id_fk": { "name": "restorations_database_id_databases_id_fk", "tableFrom": "restorations", "tableTo": "databases", "columnsFrom": [ "database_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.agents": { "name": "agents", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "slug": { "name": "slug", "type": "text", "primaryKey": false, "notNull": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": true }, "is_archived": { "name": "is_archived", "type": "boolean", "primaryKey": false, "notNull": false, "default": false }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": false }, "last_contact": { "name": "last_contact", "type": "timestamp", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { "agents_slug_unique": { "name": "agents_slug_unique", "nullsNotDistinct": false, "columns": [ "slug" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false } }, "enums": { "public.dbms_status": { "name": "dbms_status", "schema": "public", "values": [ "postgresql", "mongodb" ] }, "public.status": { "name": "status", "schema": "public", "values": [ "waiting", "ongoing", "failed", "success" ] }, "public.type_storage": { "name": "type_storage", "schema": "public", "values": [ "local", "s3" ] } }, "schemas": {}, "sequences": {}, "roles": {}, "policies": {}, "views": {}, "_meta": { "columns": {}, "schemas": {}, "tables": {} } }