- Adicionar indexes compostos em lancamentos para queries frequentes - Eliminar ~20 JOINs com pagadores via helper cacheado getAdminPagadorId() - Consolidar queries: income-expense-balance (12→1), payment-status (2→1), categories (4→2) - Adicionar cache cross-request via unstable_cache com tag-based invalidation - Limitar scan de métricas a 24 meses - Deduplicar auth session por request via React.cache() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2303 lines
59 KiB
JSON
2303 lines
59 KiB
JSON
{
|
|
"id": "af9b35da-2ada-4fbf-bcce-b371ce7117bf",
|
|
"prevId": "4ae67d34-81ae-418b-ac5b-e53b57753da1",
|
|
"version": "7",
|
|
"dialect": "postgresql",
|
|
"tables": {
|
|
"public.account": {
|
|
"name": "account",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"accountId": {
|
|
"name": "accountId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"providerId": {
|
|
"name": "providerId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"accessToken": {
|
|
"name": "accessToken",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"refreshToken": {
|
|
"name": "refreshToken",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"idToken": {
|
|
"name": "idToken",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"accessTokenExpiresAt": {
|
|
"name": "accessTokenExpiresAt",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"refreshTokenExpiresAt": {
|
|
"name": "refreshTokenExpiresAt",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"scope": {
|
|
"name": "scope",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"password": {
|
|
"name": "password",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"account_userId_user_id_fk": {
|
|
"name": "account_userId_user_id_fk",
|
|
"tableFrom": "account",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.anotacoes": {
|
|
"name": "anotacoes",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"titulo": {
|
|
"name": "titulo",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"descricao": {
|
|
"name": "descricao",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"tipo": {
|
|
"name": "tipo",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'nota'"
|
|
},
|
|
"tasks": {
|
|
"name": "tasks",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"arquivada": {
|
|
"name": "arquivada",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"anotacoes_user_id_user_id_fk": {
|
|
"name": "anotacoes_user_id_user_id_fk",
|
|
"tableFrom": "anotacoes",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.antecipacoes_parcelas": {
|
|
"name": "antecipacoes_parcelas",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"series_id": {
|
|
"name": "series_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"periodo_antecipacao": {
|
|
"name": "periodo_antecipacao",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"data_antecipacao": {
|
|
"name": "data_antecipacao",
|
|
"type": "date",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"parcelas_antecipadas": {
|
|
"name": "parcelas_antecipadas",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"valor_total": {
|
|
"name": "valor_total",
|
|
"type": "numeric(12, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"qtde_parcelas": {
|
|
"name": "qtde_parcelas",
|
|
"type": "smallint",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"desconto": {
|
|
"name": "desconto",
|
|
"type": "numeric(12, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'0'"
|
|
},
|
|
"lancamento_id": {
|
|
"name": "lancamento_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"pagador_id": {
|
|
"name": "pagador_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"categoria_id": {
|
|
"name": "categoria_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"anotacao": {
|
|
"name": "anotacao",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"antecipacoes_parcelas_series_id_idx": {
|
|
"name": "antecipacoes_parcelas_series_id_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "series_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"antecipacoes_parcelas_user_id_idx": {
|
|
"name": "antecipacoes_parcelas_user_id_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"antecipacoes_parcelas_lancamento_id_lancamentos_id_fk": {
|
|
"name": "antecipacoes_parcelas_lancamento_id_lancamentos_id_fk",
|
|
"tableFrom": "antecipacoes_parcelas",
|
|
"tableTo": "lancamentos",
|
|
"columnsFrom": [
|
|
"lancamento_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"antecipacoes_parcelas_pagador_id_pagadores_id_fk": {
|
|
"name": "antecipacoes_parcelas_pagador_id_pagadores_id_fk",
|
|
"tableFrom": "antecipacoes_parcelas",
|
|
"tableTo": "pagadores",
|
|
"columnsFrom": [
|
|
"pagador_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"antecipacoes_parcelas_categoria_id_categorias_id_fk": {
|
|
"name": "antecipacoes_parcelas_categoria_id_categorias_id_fk",
|
|
"tableFrom": "antecipacoes_parcelas",
|
|
"tableTo": "categorias",
|
|
"columnsFrom": [
|
|
"categoria_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"antecipacoes_parcelas_user_id_user_id_fk": {
|
|
"name": "antecipacoes_parcelas_user_id_user_id_fk",
|
|
"tableFrom": "antecipacoes_parcelas",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.cartoes": {
|
|
"name": "cartoes",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"nome": {
|
|
"name": "nome",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"dt_fechamento": {
|
|
"name": "dt_fechamento",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"dt_vencimento": {
|
|
"name": "dt_vencimento",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"anotacao": {
|
|
"name": "anotacao",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"limite": {
|
|
"name": "limite",
|
|
"type": "numeric(10, 2)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"bandeira": {
|
|
"name": "bandeira",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"logo": {
|
|
"name": "logo",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"conta_id": {
|
|
"name": "conta_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"indexes": {
|
|
"cartoes_user_id_status_idx": {
|
|
"name": "cartoes_user_id_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": {
|
|
"cartoes_user_id_user_id_fk": {
|
|
"name": "cartoes_user_id_user_id_fk",
|
|
"tableFrom": "cartoes",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"cartoes_conta_id_contas_id_fk": {
|
|
"name": "cartoes_conta_id_contas_id_fk",
|
|
"tableFrom": "cartoes",
|
|
"tableTo": "contas",
|
|
"columnsFrom": [
|
|
"conta_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "cascade"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.categorias": {
|
|
"name": "categorias",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"nome": {
|
|
"name": "nome",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"tipo": {
|
|
"name": "tipo",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"icone": {
|
|
"name": "icone",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"indexes": {
|
|
"categorias_user_id_type_idx": {
|
|
"name": "categorias_user_id_type_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "tipo",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"categorias_user_id_user_id_fk": {
|
|
"name": "categorias_user_id_user_id_fk",
|
|
"tableFrom": "categorias",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.compartilhamentos_pagador": {
|
|
"name": "compartilhamentos_pagador",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"pagador_id": {
|
|
"name": "pagador_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"shared_with_user_id": {
|
|
"name": "shared_with_user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"permission": {
|
|
"name": "permission",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'read'"
|
|
},
|
|
"created_by_user_id": {
|
|
"name": "created_by_user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"compartilhamentos_pagador_unique": {
|
|
"name": "compartilhamentos_pagador_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "pagador_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "shared_with_user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"compartilhamentos_pagador_pagador_id_pagadores_id_fk": {
|
|
"name": "compartilhamentos_pagador_pagador_id_pagadores_id_fk",
|
|
"tableFrom": "compartilhamentos_pagador",
|
|
"tableTo": "pagadores",
|
|
"columnsFrom": [
|
|
"pagador_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"compartilhamentos_pagador_shared_with_user_id_user_id_fk": {
|
|
"name": "compartilhamentos_pagador_shared_with_user_id_user_id_fk",
|
|
"tableFrom": "compartilhamentos_pagador",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"shared_with_user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"compartilhamentos_pagador_created_by_user_id_user_id_fk": {
|
|
"name": "compartilhamentos_pagador_created_by_user_id_user_id_fk",
|
|
"tableFrom": "compartilhamentos_pagador",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"created_by_user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.contas": {
|
|
"name": "contas",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"nome": {
|
|
"name": "nome",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"tipo_conta": {
|
|
"name": "tipo_conta",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"anotacao": {
|
|
"name": "anotacao",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"logo": {
|
|
"name": "logo",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"saldo_inicial": {
|
|
"name": "saldo_inicial",
|
|
"type": "numeric(12, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'0'"
|
|
},
|
|
"excluir_do_saldo": {
|
|
"name": "excluir_do_saldo",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"excluir_saldo_inicial_receitas": {
|
|
"name": "excluir_saldo_inicial_receitas",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"contas_user_id_status_idx": {
|
|
"name": "contas_user_id_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": {
|
|
"contas_user_id_user_id_fk": {
|
|
"name": "contas_user_id_user_id_fk",
|
|
"tableFrom": "contas",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.faturas": {
|
|
"name": "faturas",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"status_pagamento": {
|
|
"name": "status_pagamento",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"periodo": {
|
|
"name": "periodo",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"cartao_id": {
|
|
"name": "cartao_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
}
|
|
},
|
|
"indexes": {
|
|
"faturas_user_id_period_idx": {
|
|
"name": "faturas_user_id_period_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "periodo",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"faturas_cartao_id_period_idx": {
|
|
"name": "faturas_cartao_id_period_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "cartao_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "periodo",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"faturas_user_id_user_id_fk": {
|
|
"name": "faturas_user_id_user_id_fk",
|
|
"tableFrom": "faturas",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"faturas_cartao_id_cartoes_id_fk": {
|
|
"name": "faturas_cartao_id_cartoes_id_fk",
|
|
"tableFrom": "faturas",
|
|
"tableTo": "cartoes",
|
|
"columnsFrom": [
|
|
"cartao_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "cascade"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.insights_salvos": {
|
|
"name": "insights_salvos",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"period": {
|
|
"name": "period",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"model_id": {
|
|
"name": "model_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"data": {
|
|
"name": "data",
|
|
"type": "text",
|
|
"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()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"insights_salvos_user_period_idx": {
|
|
"name": "insights_salvos_user_period_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "period",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"insights_salvos_user_id_user_id_fk": {
|
|
"name": "insights_salvos_user_id_user_id_fk",
|
|
"tableFrom": "insights_salvos",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.lancamentos": {
|
|
"name": "lancamentos",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"condicao": {
|
|
"name": "condicao",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"nome": {
|
|
"name": "nome",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"forma_pagamento": {
|
|
"name": "forma_pagamento",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"anotacao": {
|
|
"name": "anotacao",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"valor": {
|
|
"name": "valor",
|
|
"type": "numeric(12, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"data_compra": {
|
|
"name": "data_compra",
|
|
"type": "date",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"tipo_transacao": {
|
|
"name": "tipo_transacao",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"qtde_parcela": {
|
|
"name": "qtde_parcela",
|
|
"type": "smallint",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"periodo": {
|
|
"name": "periodo",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"parcela_atual": {
|
|
"name": "parcela_atual",
|
|
"type": "smallint",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"qtde_recorrencia": {
|
|
"name": "qtde_recorrencia",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"data_vencimento": {
|
|
"name": "data_vencimento",
|
|
"type": "date",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"dt_pagamento_boleto": {
|
|
"name": "dt_pagamento_boleto",
|
|
"type": "date",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"realizado": {
|
|
"name": "realizado",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": false
|
|
},
|
|
"dividido": {
|
|
"name": "dividido",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": false
|
|
},
|
|
"antecipado": {
|
|
"name": "antecipado",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": false
|
|
},
|
|
"antecipacao_id": {
|
|
"name": "antecipacao_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"cartao_id": {
|
|
"name": "cartao_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"conta_id": {
|
|
"name": "conta_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"categoria_id": {
|
|
"name": "categoria_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"pagador_id": {
|
|
"name": "pagador_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"series_id": {
|
|
"name": "series_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"transfer_id": {
|
|
"name": "transfer_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
}
|
|
},
|
|
"indexes": {
|
|
"lancamentos_user_id_period_idx": {
|
|
"name": "lancamentos_user_id_period_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "periodo",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"lancamentos_user_id_period_type_idx": {
|
|
"name": "lancamentos_user_id_period_type_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "periodo",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "tipo_transacao",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"lancamentos_pagador_id_period_idx": {
|
|
"name": "lancamentos_pagador_id_period_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "pagador_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "periodo",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"lancamentos_user_id_purchase_date_idx": {
|
|
"name": "lancamentos_user_id_purchase_date_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "data_compra",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"lancamentos_series_id_idx": {
|
|
"name": "lancamentos_series_id_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "series_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"lancamentos_transfer_id_idx": {
|
|
"name": "lancamentos_transfer_id_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "transfer_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"lancamentos_user_id_condition_idx": {
|
|
"name": "lancamentos_user_id_condition_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "condicao",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"lancamentos_cartao_id_period_idx": {
|
|
"name": "lancamentos_cartao_id_period_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "cartao_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "periodo",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"lancamentos_antecipacao_id_antecipacoes_parcelas_id_fk": {
|
|
"name": "lancamentos_antecipacao_id_antecipacoes_parcelas_id_fk",
|
|
"tableFrom": "lancamentos",
|
|
"tableTo": "antecipacoes_parcelas",
|
|
"columnsFrom": [
|
|
"antecipacao_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
},
|
|
"lancamentos_user_id_user_id_fk": {
|
|
"name": "lancamentos_user_id_user_id_fk",
|
|
"tableFrom": "lancamentos",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"lancamentos_cartao_id_cartoes_id_fk": {
|
|
"name": "lancamentos_cartao_id_cartoes_id_fk",
|
|
"tableFrom": "lancamentos",
|
|
"tableTo": "cartoes",
|
|
"columnsFrom": [
|
|
"cartao_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "cascade"
|
|
},
|
|
"lancamentos_conta_id_contas_id_fk": {
|
|
"name": "lancamentos_conta_id_contas_id_fk",
|
|
"tableFrom": "lancamentos",
|
|
"tableTo": "contas",
|
|
"columnsFrom": [
|
|
"conta_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "cascade"
|
|
},
|
|
"lancamentos_categoria_id_categorias_id_fk": {
|
|
"name": "lancamentos_categoria_id_categorias_id_fk",
|
|
"tableFrom": "lancamentos",
|
|
"tableTo": "categorias",
|
|
"columnsFrom": [
|
|
"categoria_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "cascade"
|
|
},
|
|
"lancamentos_pagador_id_pagadores_id_fk": {
|
|
"name": "lancamentos_pagador_id_pagadores_id_fk",
|
|
"tableFrom": "lancamentos",
|
|
"tableTo": "pagadores",
|
|
"columnsFrom": [
|
|
"pagador_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "cascade"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.orcamentos": {
|
|
"name": "orcamentos",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"valor": {
|
|
"name": "valor",
|
|
"type": "numeric(10, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"periodo": {
|
|
"name": "periodo",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"categoria_id": {
|
|
"name": "categoria_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
}
|
|
},
|
|
"indexes": {
|
|
"orcamentos_user_id_period_idx": {
|
|
"name": "orcamentos_user_id_period_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "periodo",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"orcamentos_user_id_user_id_fk": {
|
|
"name": "orcamentos_user_id_user_id_fk",
|
|
"tableFrom": "orcamentos",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"orcamentos_categoria_id_categorias_id_fk": {
|
|
"name": "orcamentos_categoria_id_categorias_id_fk",
|
|
"tableFrom": "orcamentos",
|
|
"tableTo": "categorias",
|
|
"columnsFrom": [
|
|
"categoria_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "cascade"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.pagadores": {
|
|
"name": "pagadores",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"nome": {
|
|
"name": "nome",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"avatar_url": {
|
|
"name": "avatar_url",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"anotacao": {
|
|
"name": "anotacao",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"role": {
|
|
"name": "role",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"is_auto_send": {
|
|
"name": "is_auto_send",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"share_code": {
|
|
"name": "share_code",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "substr(encode(gen_random_bytes(24), 'base64'), 1, 24)"
|
|
},
|
|
"last_mail": {
|
|
"name": "last_mail",
|
|
"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()"
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"indexes": {
|
|
"pagadores_share_code_key": {
|
|
"name": "pagadores_share_code_key",
|
|
"columns": [
|
|
{
|
|
"expression": "share_code",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"pagadores_user_id_status_idx": {
|
|
"name": "pagadores_user_id_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": {}
|
|
},
|
|
"pagadores_user_id_role_idx": {
|
|
"name": "pagadores_user_id_role_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "role",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"pagadores_user_id_user_id_fk": {
|
|
"name": "pagadores_user_id_user_id_fk",
|
|
"tableFrom": "pagadores",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.pre_lancamentos": {
|
|
"name": "pre_lancamentos",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"source_app": {
|
|
"name": "source_app",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"source_app_name": {
|
|
"name": "source_app_name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"original_title": {
|
|
"name": "original_title",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"original_text": {
|
|
"name": "original_text",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"notification_timestamp": {
|
|
"name": "notification_timestamp",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"parsed_name": {
|
|
"name": "parsed_name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"parsed_amount": {
|
|
"name": "parsed_amount",
|
|
"type": "numeric(12, 2)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'pending'"
|
|
},
|
|
"lancamento_id": {
|
|
"name": "lancamento_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"processed_at": {
|
|
"name": "processed_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"discarded_at": {
|
|
"name": "discarded_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()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"pre_lancamentos_user_id_status_idx": {
|
|
"name": "pre_lancamentos_user_id_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": {}
|
|
},
|
|
"pre_lancamentos_user_id_created_at_idx": {
|
|
"name": "pre_lancamentos_user_id_created_at_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"pre_lancamentos_user_id_user_id_fk": {
|
|
"name": "pre_lancamentos_user_id_user_id_fk",
|
|
"tableFrom": "pre_lancamentos",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"pre_lancamentos_lancamento_id_lancamentos_id_fk": {
|
|
"name": "pre_lancamentos_lancamento_id_lancamentos_id_fk",
|
|
"tableFrom": "pre_lancamentos",
|
|
"tableTo": "lancamentos",
|
|
"columnsFrom": [
|
|
"lancamento_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.preferencias_usuario": {
|
|
"name": "preferencias_usuario",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"disable_magnetlines": {
|
|
"name": "disable_magnetlines",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"dashboard_widgets": {
|
|
"name": "dashboard_widgets",
|
|
"type": "jsonb",
|
|
"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()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"preferencias_usuario_user_id_user_id_fk": {
|
|
"name": "preferencias_usuario_user_id_user_id_fk",
|
|
"tableFrom": "preferencias_usuario",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"preferencias_usuario_user_id_unique": {
|
|
"name": "preferencias_usuario_user_id_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"user_id"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.session": {
|
|
"name": "session",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"expiresAt": {
|
|
"name": "expiresAt",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"token": {
|
|
"name": "token",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"ipAddress": {
|
|
"name": "ipAddress",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"userAgent": {
|
|
"name": "userAgent",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"session_userId_user_id_fk": {
|
|
"name": "session_userId_user_id_fk",
|
|
"tableFrom": "session",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"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.tokens_api": {
|
|
"name": "tokens_api",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"token_hash": {
|
|
"name": "token_hash",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"token_prefix": {
|
|
"name": "token_prefix",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"last_used_at": {
|
|
"name": "last_used_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"last_used_ip": {
|
|
"name": "last_used_ip",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"expires_at": {
|
|
"name": "expires_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"revoked_at": {
|
|
"name": "revoked_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()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"tokens_api_user_id_idx": {
|
|
"name": "tokens_api_user_id_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"tokens_api_token_hash_idx": {
|
|
"name": "tokens_api_token_hash_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "token_hash",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"tokens_api_user_id_user_id_fk": {
|
|
"name": "tokens_api_user_id_user_id_fk",
|
|
"tableFrom": "tokens_api",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.user": {
|
|
"name": "user",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"emailVerified": {
|
|
"name": "emailVerified",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"image": {
|
|
"name": "image",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"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": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"identifier": {
|
|
"name": "identifier",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"value": {
|
|
"name": "value",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"expiresAt": {
|
|
"name": "expiresAt",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
}
|
|
},
|
|
"enums": {},
|
|
"schemas": {},
|
|
"sequences": {},
|
|
"roles": {},
|
|
"policies": {},
|
|
"views": {},
|
|
"_meta": {
|
|
"columns": {},
|
|
"schemas": {},
|
|
"tables": {}
|
|
}
|
|
} |