{ "id": "de6718aa-a69c-4f5b-8cfa-5a4a7b3a470b", "prevId": "00000000-0000-0000-0000-000000000000", "version": "7", "dialect": "postgresql", "tables": { "public.carrito": { "name": "carrito", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "usuario_id": { "name": "usuario_id", "type": "text", "primaryKey": false, "notNull": false }, "creado_en": { "name": "creado_en", "type": "timestamp with time zone", "primaryKey": false, "notNull": true }, "actualizado_en": { "name": "actualizado_en", "type": "timestamp with time zone", "primaryKey": false, "notNull": true } }, "indexes": { "carrito_usuario": { "name": "carrito_usuario", "columns": [ { "expression": "usuario_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "carrito_usuario_id_usuario_id_fk": { "name": "carrito_usuario_id_usuario_id_fk", "tableFrom": "carrito", "tableTo": "usuario", "columnsFrom": [ "usuario_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.carrito_item": { "name": "carrito_item", "schema": "", "columns": { "carrito_id": { "name": "carrito_id", "type": "text", "primaryKey": false, "notNull": true }, "cancion_slug": { "name": "cancion_slug", "type": "text", "primaryKey": false, "notNull": true }, "anadido_en": { "name": "anadido_en", "type": "timestamp with time zone", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": { "carrito_item_carrito_id_carrito_id_fk": { "name": "carrito_item_carrito_id_carrito_id_fk", "tableFrom": "carrito_item", "tableTo": "carrito", "columnsFrom": [ "carrito_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": { "carrito_item_carrito_id_cancion_slug_pk": { "name": "carrito_item_carrito_id_cancion_slug_pk", "columns": [ "carrito_id", "cancion_slug" ] } }, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.codigo_acceso": { "name": "codigo_acceso", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "email": { "name": "email", "type": "text", "primaryKey": false, "notNull": true }, "hash": { "name": "hash", "type": "text", "primaryKey": false, "notNull": true }, "expira_en": { "name": "expira_en", "type": "timestamp with time zone", "primaryKey": false, "notNull": true }, "intentos": { "name": "intentos", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "usado_en": { "name": "usado_en", "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "creado_en": { "name": "creado_en", "type": "timestamp with time zone", "primaryKey": false, "notNull": true } }, "indexes": { "codigo_acceso_email": { "name": "codigo_acceso_email", "columns": [ { "expression": "email", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.compra": { "name": "compra", "schema": "", "columns": { "usuario_id": { "name": "usuario_id", "type": "text", "primaryKey": false, "notNull": true }, "cancion_slug": { "name": "cancion_slug", "type": "text", "primaryKey": false, "notNull": true }, "pedido_id": { "name": "pedido_id", "type": "text", "primaryKey": false, "notNull": true }, "comprado_en": { "name": "comprado_en", "type": "timestamp with time zone", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": { "compra_usuario_id_usuario_id_fk": { "name": "compra_usuario_id_usuario_id_fk", "tableFrom": "compra", "tableTo": "usuario", "columnsFrom": [ "usuario_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "compra_pedido_id_pedido_id_fk": { "name": "compra_pedido_id_pedido_id_fk", "tableFrom": "compra", "tableTo": "pedido", "columnsFrom": [ "pedido_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": { "compra_usuario_id_cancion_slug_pk": { "name": "compra_usuario_id_cancion_slug_pk", "columns": [ "usuario_id", "cancion_slug" ] } }, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.favorito": { "name": "favorito", "schema": "", "columns": { "usuario_id": { "name": "usuario_id", "type": "text", "primaryKey": false, "notNull": true }, "cancion_slug": { "name": "cancion_slug", "type": "text", "primaryKey": false, "notNull": true }, "marcado_en": { "name": "marcado_en", "type": "timestamp with time zone", "primaryKey": false, "notNull": true } }, "indexes": { "idx_favorito_usuario": { "name": "idx_favorito_usuario", "columns": [ { "expression": "usuario_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "favorito_usuario_id_usuario_id_fk": { "name": "favorito_usuario_id_usuario_id_fk", "tableFrom": "favorito", "tableTo": "usuario", "columnsFrom": [ "usuario_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": { "favorito_usuario_id_cancion_slug_pk": { "name": "favorito_usuario_id_cancion_slug_pk", "columns": [ "usuario_id", "cancion_slug" ] } }, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.limite": { "name": "limite", "schema": "", "columns": { "clave": { "name": "clave", "type": "text", "primaryKey": true, "notNull": true }, "intentos": { "name": "intentos", "type": "integer", "primaryKey": false, "notNull": true }, "expira_en": { "name": "expira_en", "type": "bigint", "primaryKey": false, "notNull": true } }, "indexes": { "limite_expira": { "name": "limite_expira", "columns": [ { "expression": "expira_en", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.pedido": { "name": "pedido", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "usuario_id": { "name": "usuario_id", "type": "text", "primaryKey": false, "notNull": true }, "sesion_pago_id": { "name": "sesion_pago_id", "type": "text", "primaryKey": false, "notNull": true }, "estado": { "name": "estado", "type": "text", "primaryKey": false, "notNull": true, "default": "'pendiente'" }, "packs": { "name": "packs", "type": "integer", "primaryKey": false, "notNull": true }, "total_centimos": { "name": "total_centimos", "type": "integer", "primaryKey": false, "notNull": true }, "moneda": { "name": "moneda", "type": "text", "primaryKey": false, "notNull": true, "default": "'eur'" }, "creado_en": { "name": "creado_en", "type": "timestamp with time zone", "primaryKey": false, "notNull": true }, "pagado_en": { "name": "pagado_en", "type": "timestamp with time zone", "primaryKey": false, "notNull": false } }, "indexes": { "pedido_usuario": { "name": "pedido_usuario", "columns": [ { "expression": "usuario_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "pedido_usuario_id_usuario_id_fk": { "name": "pedido_usuario_id_usuario_id_fk", "tableFrom": "pedido", "tableTo": "usuario", "columnsFrom": [ "usuario_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "pedido_sesion_pago_id_unique": { "name": "pedido_sesion_pago_id_unique", "nullsNotDistinct": false, "columns": [ "sesion_pago_id" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.pedido_item": { "name": "pedido_item", "schema": "", "columns": { "pedido_id": { "name": "pedido_id", "type": "text", "primaryKey": false, "notNull": true }, "cancion_slug": { "name": "cancion_slug", "type": "text", "primaryKey": false, "notNull": true }, "titulo": { "name": "titulo", "type": "text", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": { "pedido_item_pedido_id_pedido_id_fk": { "name": "pedido_item_pedido_id_pedido_id_fk", "tableFrom": "pedido_item", "tableTo": "pedido", "columnsFrom": [ "pedido_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": { "pedido_item_pedido_id_cancion_slug_pk": { "name": "pedido_item_pedido_id_cancion_slug_pk", "columns": [ "pedido_id", "cancion_slug" ] } }, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.sesion": { "name": "sesion", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "usuario_id": { "name": "usuario_id", "type": "text", "primaryKey": false, "notNull": true }, "expira_en": { "name": "expira_en", "type": "timestamp with time zone", "primaryKey": false, "notNull": true }, "creada_en": { "name": "creada_en", "type": "timestamp with time zone", "primaryKey": false, "notNull": true } }, "indexes": { "sesion_usuario": { "name": "sesion_usuario", "columns": [ { "expression": "usuario_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "sesion_usuario_id_usuario_id_fk": { "name": "sesion_usuario_id_usuario_id_fk", "tableFrom": "sesion", "tableTo": "usuario", "columnsFrom": [ "usuario_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.usuario": { "name": "usuario", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "email": { "name": "email", "type": "text", "primaryKey": false, "notNull": true }, "nombre": { "name": "nombre", "type": "text", "primaryKey": false, "notNull": false }, "creado_en": { "name": "creado_en", "type": "timestamp with time zone", "primaryKey": false, "notNull": true }, "ultimo_acceso_en": { "name": "ultimo_acceso_en", "type": "timestamp with time zone", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { "usuario_email_unique": { "name": "usuario_email_unique", "nullsNotDistinct": false, "columns": [ "email" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.valoracion": { "name": "valoracion", "schema": "", "columns": { "usuario_id": { "name": "usuario_id", "type": "text", "primaryKey": false, "notNull": true }, "cancion_slug": { "name": "cancion_slug", "type": "text", "primaryKey": false, "notNull": true }, "puntuacion": { "name": "puntuacion", "type": "integer", "primaryKey": false, "notNull": true }, "creada_en": { "name": "creada_en", "type": "timestamp with time zone", "primaryKey": false, "notNull": true }, "actualizada_en": { "name": "actualizada_en", "type": "timestamp with time zone", "primaryKey": false, "notNull": true } }, "indexes": { "idx_valoracion_cancion": { "name": "idx_valoracion_cancion", "columns": [ { "expression": "cancion_slug", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "valoracion_usuario_id_usuario_id_fk": { "name": "valoracion_usuario_id_usuario_id_fk", "tableFrom": "valoracion", "tableTo": "usuario", "columnsFrom": [ "usuario_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": { "valoracion_usuario_id_cancion_slug_pk": { "name": "valoracion_usuario_id_cancion_slug_pk", "columns": [ "usuario_id", "cancion_slug" ] } }, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false } }, "enums": {}, "schemas": {}, "sequences": {}, "roles": {}, "policies": {}, "views": {}, "_meta": { "columns": {}, "schemas": {}, "tables": {} } }