Brings the working codebase (Next.js app, auth system, Stripe billing, Docker/deploy config, tests, docs) into version control on top of the placeholder initial commit, and adds account self-deletion (Danger Zone in Settings, password + typed-email confirmation, cascading DB cleanup, Stripe cancellation) per GDPR right-to-erasure. Excludes local build caches, node_modules, and internal agent scratch files; .gitignore hardened to keep those out going forward. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1461 lines
37 KiB
JSON
1461 lines
37 KiB
JSON
{
|
|
"id": "4cebaa99-e778-4b9c-a069-52e18ff27c48",
|
|
"prevId": "61572c0b-c3f0-4e59-978c-8ce2ca0c1688",
|
|
"version": "7",
|
|
"dialect": "postgresql",
|
|
"tables": {
|
|
"public.email_verification_tokens": {
|
|
"name": "email_verification_tokens",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"expires_at": {
|
|
"name": "expires_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"consumed_at": {
|
|
"name": "consumed_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_email_verification_user_id": {
|
|
"name": "idx_email_verification_user_id",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_email_verification_expires_at": {
|
|
"name": "idx_email_verification_expires_at",
|
|
"columns": [
|
|
{
|
|
"expression": "expires_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"email_verification_tokens_user_id_users_id_fk": {
|
|
"name": "email_verification_tokens_user_id_users_id_fk",
|
|
"tableFrom": "email_verification_tokens",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.guest_sessions": {
|
|
"name": "guest_sessions",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"ip_hash": {
|
|
"name": "ip_hash",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"scan_count": {
|
|
"name": "scan_count",
|
|
"type": "numeric",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'0'"
|
|
},
|
|
"last_scan_at": {
|
|
"name": "last_scan_at",
|
|
"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": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_guest_sessions_ip": {
|
|
"name": "idx_guest_sessions_ip",
|
|
"columns": [
|
|
{
|
|
"expression": "ip_hash",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.launch_claims": {
|
|
"name": "launch_claims",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"position": {
|
|
"name": "position",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"uq_launch_claims_user_id": {
|
|
"name": "uq_launch_claims_user_id",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"uq_launch_claims_position": {
|
|
"name": "uq_launch_claims_position",
|
|
"columns": [
|
|
{
|
|
"expression": "position",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"launch_claims_user_id_users_id_fk": {
|
|
"name": "launch_claims_user_id_users_id_fk",
|
|
"tableFrom": "launch_claims",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.licenses": {
|
|
"name": "licenses",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"license_key": {
|
|
"name": "license_key",
|
|
"type": "varchar(128)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"plan": {
|
|
"name": "plan",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'active'"
|
|
},
|
|
"stripe_customer_id": {
|
|
"name": "stripe_customer_id",
|
|
"type": "varchar(128)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"stripe_subscription_id": {
|
|
"name": "stripe_subscription_id",
|
|
"type": "varchar(128)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"stripe_checkout_session_id": {
|
|
"name": "stripe_checkout_session_id",
|
|
"type": "varchar(128)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"activated_at": {
|
|
"name": "activated_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"expires_at": {
|
|
"name": "expires_at",
|
|
"type": "timestamp",
|
|
"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": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_licenses_key": {
|
|
"name": "idx_licenses_key",
|
|
"columns": [
|
|
{
|
|
"expression": "license_key",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_licenses_user_id": {
|
|
"name": "idx_licenses_user_id",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_licenses_sub_id": {
|
|
"name": "idx_licenses_sub_id",
|
|
"columns": [
|
|
{
|
|
"expression": "stripe_subscription_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"licenses_user_id_users_id_fk": {
|
|
"name": "licenses_user_id_users_id_fk",
|
|
"tableFrom": "licenses",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"licenses_license_key_unique": {
|
|
"name": "licenses_license_key_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"license_key"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.line_items": {
|
|
"name": "line_items",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"receipt_id": {
|
|
"name": "receipt_id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"description": {
|
|
"name": "description",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"quantity": {
|
|
"name": "quantity",
|
|
"type": "numeric(10, 3)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'1'"
|
|
},
|
|
"price": {
|
|
"name": "price",
|
|
"type": "numeric(12, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"unit_price": {
|
|
"name": "unit_price",
|
|
"type": "numeric(12, 2)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"tax_rate": {
|
|
"name": "tax_rate",
|
|
"type": "numeric(5, 2)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_line_items_receipt_id": {
|
|
"name": "idx_line_items_receipt_id",
|
|
"columns": [
|
|
{
|
|
"expression": "receipt_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"line_items_receipt_id_receipts_id_fk": {
|
|
"name": "line_items_receipt_id_receipts_id_fk",
|
|
"tableFrom": "line_items",
|
|
"tableTo": "receipts",
|
|
"columnsFrom": [
|
|
"receipt_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.oauth_accounts": {
|
|
"name": "oauth_accounts",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"provider": {
|
|
"name": "provider",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"provider_account_id": {
|
|
"name": "provider_account_id",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"uq_oauth_provider_account": {
|
|
"name": "uq_oauth_provider_account",
|
|
"columns": [
|
|
{
|
|
"expression": "provider",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "provider_account_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_oauth_accounts_user_id": {
|
|
"name": "idx_oauth_accounts_user_id",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"oauth_accounts_user_id_users_id_fk": {
|
|
"name": "oauth_accounts_user_id_users_id_fk",
|
|
"tableFrom": "oauth_accounts",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.password_reset_tokens": {
|
|
"name": "password_reset_tokens",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"expires_at": {
|
|
"name": "expires_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"consumed_at": {
|
|
"name": "consumed_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"requested_ip_hash": {
|
|
"name": "requested_ip_hash",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_password_reset_user_id": {
|
|
"name": "idx_password_reset_user_id",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_password_reset_expires_at": {
|
|
"name": "idx_password_reset_expires_at",
|
|
"columns": [
|
|
{
|
|
"expression": "expires_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"password_reset_tokens_user_id_users_id_fk": {
|
|
"name": "password_reset_tokens_user_id_users_id_fk",
|
|
"tableFrom": "password_reset_tokens",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.receipts": {
|
|
"name": "receipts",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"image_hash": {
|
|
"name": "image_hash",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"storage_url": {
|
|
"name": "storage_url",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"merchant_name": {
|
|
"name": "merchant_name",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"receipt_date": {
|
|
"name": "receipt_date",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"receipt_number": {
|
|
"name": "receipt_number",
|
|
"type": "varchar(128)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"document_type": {
|
|
"name": "document_type",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'KASSENBON'"
|
|
},
|
|
"category": {
|
|
"name": "category",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'Sonstiges'"
|
|
},
|
|
"currency": {
|
|
"name": "currency",
|
|
"type": "varchar(8)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'EUR'"
|
|
},
|
|
"total_amount": {
|
|
"name": "total_amount",
|
|
"type": "numeric(12, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"net_amount": {
|
|
"name": "net_amount",
|
|
"type": "numeric(12, 2)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"tax_7_amount": {
|
|
"name": "tax_7_amount",
|
|
"type": "numeric(12, 2)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"tax_19_amount": {
|
|
"name": "tax_19_amount",
|
|
"type": "numeric(12, 2)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"tip_amount": {
|
|
"name": "tip_amount",
|
|
"type": "numeric(12, 2)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"tax_breakdown_json": {
|
|
"name": "tax_breakdown_json",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"line_items_json": {
|
|
"name": "line_items_json",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"validation_json": {
|
|
"name": "validation_json",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"raw_ocr_text": {
|
|
"name": "raw_ocr_text",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"payment_method": {
|
|
"name": "payment_method",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"is_math_valid": {
|
|
"name": "is_math_valid",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"needs_review": {
|
|
"name": "needs_review",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"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": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_receipts_user_date": {
|
|
"name": "idx_receipts_user_date",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "receipt_date",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_receipts_hash": {
|
|
"name": "idx_receipts_hash",
|
|
"columns": [
|
|
{
|
|
"expression": "image_hash",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_receipts_duplicate_check": {
|
|
"name": "idx_receipts_duplicate_check",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "merchant_name",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "total_amount",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "receipt_date",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"receipts_user_id_users_id_fk": {
|
|
"name": "receipts_user_id_users_id_fk",
|
|
"tableFrom": "receipts",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.security_events": {
|
|
"name": "security_events",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"type": {
|
|
"name": "type",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"ip_hash": {
|
|
"name": "ip_hash",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"user_agent": {
|
|
"name": "user_agent",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"metadata_json": {
|
|
"name": "metadata_json",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_security_events_type_created": {
|
|
"name": "idx_security_events_type_created",
|
|
"columns": [
|
|
{
|
|
"expression": "type",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_security_events_user_created": {
|
|
"name": "idx_security_events_user_created",
|
|
"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": {}
|
|
},
|
|
"idx_security_events_ip_created": {
|
|
"name": "idx_security_events_ip_created",
|
|
"columns": [
|
|
{
|
|
"expression": "ip_hash",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"security_events_user_id_users_id_fk": {
|
|
"name": "security_events_user_id_users_id_fk",
|
|
"tableFrom": "security_events",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.sessions": {
|
|
"name": "sessions",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"expires_at": {
|
|
"name": "expires_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"user_agent": {
|
|
"name": "user_agent",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"ip_hash": {
|
|
"name": "ip_hash",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_sessions_user_id": {
|
|
"name": "idx_sessions_user_id",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_sessions_expires_at": {
|
|
"name": "idx_sessions_expires_at",
|
|
"columns": [
|
|
{
|
|
"expression": "expires_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"sessions_user_id_users_id_fk": {
|
|
"name": "sessions_user_id_users_id_fk",
|
|
"tableFrom": "sessions",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.users": {
|
|
"name": "users",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"email_key": {
|
|
"name": "email_key",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "varchar(160)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"password_hash": {
|
|
"name": "password_hash",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"email_verified_at": {
|
|
"name": "email_verified_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"is_guest": {
|
|
"name": "is_guest",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"plan": {
|
|
"name": "plan",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'free'"
|
|
},
|
|
"stripe_customer_id": {
|
|
"name": "stripe_customer_id",
|
|
"type": "varchar(128)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"stripe_subscription_id": {
|
|
"name": "stripe_subscription_id",
|
|
"type": "varchar(128)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"scan_count": {
|
|
"name": "scan_count",
|
|
"type": "numeric",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'0'"
|
|
},
|
|
"scan_period": {
|
|
"name": "scan_period",
|
|
"type": "varchar(7)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"expires_at": {
|
|
"name": "expires_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"company": {
|
|
"name": "company",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"use_case": {
|
|
"name": "use_case",
|
|
"type": "varchar(100)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"referral_source": {
|
|
"name": "referral_source",
|
|
"type": "varchar(100)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"onboarding_completed_at": {
|
|
"name": "onboarding_completed_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"launch_bonus": {
|
|
"name": "launch_bonus",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"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": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"idx_users_email": {
|
|
"name": "idx_users_email",
|
|
"columns": [
|
|
{
|
|
"expression": "email",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_users_guest_created": {
|
|
"name": "idx_users_guest_created",
|
|
"columns": [
|
|
{
|
|
"expression": "is_guest",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"uq_users_email_key": {
|
|
"name": "uq_users_email_key",
|
|
"columns": [
|
|
{
|
|
"expression": "email_key",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.waitlist": {
|
|
"name": "waitlist",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "varchar(64)",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "varchar(160)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"source": {
|
|
"name": "source",
|
|
"type": "varchar(100)",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'landing_page'"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"uq_waitlist_email": {
|
|
"name": "uq_waitlist_email",
|
|
"columns": [
|
|
{
|
|
"expression": "email",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"idx_waitlist_created_at": {
|
|
"name": "idx_waitlist_created_at",
|
|
"columns": [
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
}
|
|
},
|
|
"enums": {},
|
|
"schemas": {},
|
|
"sequences": {},
|
|
"roles": {},
|
|
"policies": {},
|
|
"views": {},
|
|
"_meta": {
|
|
"columns": {},
|
|
"schemas": {},
|
|
"tables": {}
|
|
}
|
|
} |