{ "id": "6046c1bc-2d5f-4842-9d8a-037c18583ebf", "prevId": "012d366d-9441-4a0b-b1ab-818fd846a8c1", "version": "7", "dialect": "postgresql", "tables": { "public.financial_balances": { "name": "financial_balances", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": false }, "balance": { "name": "balance", "type": "double precision", "primaryKey": false, "notNull": false }, "balance_date": { "name": "balance_date", "type": "bigint", "primaryKey": false, "notNull": false }, "encrypted_data": { "name": "encrypted_data", "type": "text", "primaryKey": false, "notNull": false }, "created_on": { "name": "created_on", "type": "bigint", "primaryKey": false, "notNull": false }, "updated_on": { "name": "updated_on", "type": "bigint", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "financial_balances_user_id_users_id_fk": { "name": "financial_balances_user_id_users_id_fk", "tableFrom": "financial_balances", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.incomes": { "name": "incomes", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": false }, "source": { "name": "source", "type": "text", "primaryKey": false, "notNull": false }, "amount": { "name": "amount", "type": "double precision", "primaryKey": false, "notNull": false }, "frequency": { "name": "frequency", "type": "text", "primaryKey": false, "notNull": false }, "received_date": { "name": "received_date", "type": "bigint", "primaryKey": false, "notNull": false }, "encrypted_data": { "name": "encrypted_data", "type": "text", "primaryKey": false, "notNull": false }, "created_on": { "name": "created_on", "type": "bigint", "primaryKey": false, "notNull": false }, "updated_on": { "name": "updated_on", "type": "bigint", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "incomes_user_id_users_id_fk": { "name": "incomes_user_id_users_id_fk", "tableFrom": "incomes", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.lease_documents": { "name": "lease_documents", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "lease_id": { "name": "lease_id", "type": "text", "primaryKey": false, "notNull": false }, "document_type": { "name": "document_type", "type": "text", "primaryKey": false, "notNull": false }, "file_url": { "name": "file_url", "type": "text", "primaryKey": false, "notNull": false }, "file_name": { "name": "file_name", "type": "text", "primaryKey": false, "notNull": false }, "signed_by_landlord": { "name": "signed_by_landlord", "type": "boolean", "primaryKey": false, "notNull": false, "default": false }, "signed_by_tenant": { "name": "signed_by_tenant", "type": "boolean", "primaryKey": false, "notNull": false, "default": false }, "signature_date": { "name": "signature_date", "type": "bigint", "primaryKey": false, "notNull": false }, "created_on": { "name": "created_on", "type": "bigint", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "lease_documents_lease_id_leases_id_fk": { "name": "lease_documents_lease_id_leases_id_fk", "tableFrom": "lease_documents", "tableTo": "leases", "columnsFrom": [ "lease_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.leases": { "name": "leases", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "title": { "name": "title", "type": "text", "primaryKey": false, "notNull": false }, "property_id": { "name": "property_id", "type": "text", "primaryKey": false, "notNull": false }, "property_address": { "name": "property_address", "type": "text", "primaryKey": false, "notNull": false }, "tenant_id": { "name": "tenant_id", "type": "text", "primaryKey": false, "notNull": false }, "owner_id": { "name": "owner_id", "type": "text", "primaryKey": false, "notNull": false }, "start_date": { "name": "start_date", "type": "bigint", "primaryKey": false, "notNull": false }, "end_date": { "name": "end_date", "type": "bigint", "primaryKey": false, "notNull": false }, "rent": { "name": "rent", "type": "double precision", "primaryKey": false, "notNull": false }, "security_deposit": { "name": "security_deposit", "type": "double precision", "primaryKey": false, "notNull": false }, "default_payment_method_id": { "name": "default_payment_method_id", "type": "text", "primaryKey": false, "notNull": false }, "lease_status": { "name": "lease_status", "type": "text", "primaryKey": false, "notNull": false }, "lease_document_url": { "name": "lease_document_url", "type": "text", "primaryKey": false, "notNull": false }, "payment_schedule_id": { "name": "payment_schedule_id", "type": "text", "primaryKey": false, "notNull": false }, "late_fee_rules": { "name": "late_fee_rules", "type": "text", "primaryKey": false, "notNull": false }, "auto_renewal": { "name": "auto_renewal", "type": "boolean", "primaryKey": false, "notNull": false, "default": false }, "approval_status": { "name": "approval_status", "type": "text", "primaryKey": false, "notNull": false, "default": "'pending_approval'" }, "approval_requested_at": { "name": "approval_requested_at", "type": "bigint", "primaryKey": false, "notNull": false }, "approved_at": { "name": "approved_at", "type": "bigint", "primaryKey": false, "notNull": false }, "approved_by": { "name": "approved_by", "type": "text", "primaryKey": false, "notNull": false }, "rejection_reason": { "name": "rejection_reason", "type": "text", "primaryKey": false, "notNull": false }, "encrypted_data": { "name": "encrypted_data", "type": "text", "primaryKey": false, "notNull": false }, "created_on": { "name": "created_on", "type": "bigint", "primaryKey": false, "notNull": false }, "updated_on": { "name": "updated_on", "type": "bigint", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "leases_property_id_properties_id_fk": { "name": "leases_property_id_properties_id_fk", "tableFrom": "leases", "tableTo": "properties", "columnsFrom": [ "property_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "leases_tenant_id_users_id_fk": { "name": "leases_tenant_id_users_id_fk", "tableFrom": "leases", "tableTo": "users", "columnsFrom": [ "tenant_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "leases_owner_id_users_id_fk": { "name": "leases_owner_id_users_id_fk", "tableFrom": "leases", "tableTo": "users", "columnsFrom": [ "owner_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "leases_default_payment_method_id_payment_methods_id_fk": { "name": "leases_default_payment_method_id_payment_methods_id_fk", "tableFrom": "leases", "tableTo": "payment_methods", "columnsFrom": [ "default_payment_method_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "leases_payment_schedule_id_rent_schedules_id_fk": { "name": "leases_payment_schedule_id_rent_schedules_id_fk", "tableFrom": "leases", "tableTo": "rent_schedules", "columnsFrom": [ "payment_schedule_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "leases_approved_by_users_id_fk": { "name": "leases_approved_by_users_id_fk", "tableFrom": "leases", "tableTo": "users", "columnsFrom": [ "approved_by" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.maintenance_requests": { "name": "maintenance_requests", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "property_id": { "name": "property_id", "type": "text", "primaryKey": false, "notNull": false }, "tenant_id": { "name": "tenant_id", "type": "text", "primaryKey": false, "notNull": false }, "request_type": { "name": "request_type", "type": "text", "primaryKey": false, "notNull": false }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": false }, "priority": { "name": "priority", "type": "text", "primaryKey": false, "notNull": false }, "created_on": { "name": "created_on", "type": "bigint", "primaryKey": false, "notNull": false }, "resolved_on": { "name": "resolved_on", "type": "bigint", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "maintenance_requests_property_id_properties_id_fk": { "name": "maintenance_requests_property_id_properties_id_fk", "tableFrom": "maintenance_requests", "tableTo": "properties", "columnsFrom": [ "property_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "maintenance_requests_tenant_id_users_id_fk": { "name": "maintenance_requests_tenant_id_users_id_fk", "tableFrom": "maintenance_requests", "tableTo": "users", "columnsFrom": [ "tenant_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.messages": { "name": "messages", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "lease_id": { "name": "lease_id", "type": "text", "primaryKey": false, "notNull": false }, "sender_id": { "name": "sender_id", "type": "text", "primaryKey": false, "notNull": false }, "recipient_id": { "name": "recipient_id", "type": "text", "primaryKey": false, "notNull": false }, "message_type": { "name": "message_type", "type": "text", "primaryKey": false, "notNull": false }, "subject": { "name": "subject", "type": "text", "primaryKey": false, "notNull": false }, "parent_message_id": { "name": "parent_message_id", "type": "text", "primaryKey": false, "notNull": false }, "attachments_json": { "name": "attachments_json", "type": "json", "primaryKey": false, "notNull": false }, "content": { "name": "content", "type": "text", "primaryKey": false, "notNull": false }, "content_encrypted": { "name": "content_encrypted", "type": "text", "primaryKey": false, "notNull": false }, "is_read": { "name": "is_read", "type": "boolean", "primaryKey": false, "notNull": false, "default": false }, "created_on": { "name": "created_on", "type": "bigint", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "messages_lease_id_leases_id_fk": { "name": "messages_lease_id_leases_id_fk", "tableFrom": "messages", "tableTo": "leases", "columnsFrom": [ "lease_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "messages_sender_id_users_id_fk": { "name": "messages_sender_id_users_id_fk", "tableFrom": "messages", "tableTo": "users", "columnsFrom": [ "sender_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "messages_recipient_id_users_id_fk": { "name": "messages_recipient_id_users_id_fk", "tableFrom": "messages", "tableTo": "users", "columnsFrom": [ "recipient_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.obligations": { "name": "obligations", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": false }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": false }, "amount": { "name": "amount", "type": "double precision", "primaryKey": false, "notNull": false }, "frequency": { "name": "frequency", "type": "text", "primaryKey": false, "notNull": false }, "due_date": { "name": "due_date", "type": "bigint", "primaryKey": false, "notNull": false }, "encrypted_data": { "name": "encrypted_data", "type": "text", "primaryKey": false, "notNull": false }, "created_on": { "name": "created_on", "type": "bigint", "primaryKey": false, "notNull": false }, "updated_on": { "name": "updated_on", "type": "bigint", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "obligations_user_id_users_id_fk": { "name": "obligations_user_id_users_id_fk", "tableFrom": "obligations", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.payment_methods": { "name": "payment_methods", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": false }, "method_type": { "name": "method_type", "type": "text", "primaryKey": false, "notNull": false }, "bank_name": { "name": "bank_name", "type": "text", "primaryKey": false, "notNull": false }, "account_type": { "name": "account_type", "type": "text", "primaryKey": false, "notNull": false }, "routing_number_encrypted": { "name": "routing_number_encrypted", "type": "text", "primaryKey": false, "notNull": false }, "account_number_encrypted": { "name": "account_number_encrypted", "type": "text", "primaryKey": false, "notNull": false }, "is_default": { "name": "is_default", "type": "boolean", "primaryKey": false, "notNull": false, "default": false }, "created_on": { "name": "created_on", "type": "bigint", "primaryKey": false, "notNull": false }, "updated_on": { "name": "updated_on", "type": "bigint", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "payment_methods_user_id_users_id_fk": { "name": "payment_methods_user_id_users_id_fk", "tableFrom": "payment_methods", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.payment_transactions": { "name": "payment_transactions", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "lease_id": { "name": "lease_id", "type": "text", "primaryKey": false, "notNull": false }, "amount": { "name": "amount", "type": "double precision", "primaryKey": false, "notNull": false }, "payment_date": { "name": "payment_date", "type": "bigint", "primaryKey": false, "notNull": false }, "payment_method": { "name": "payment_method", "type": "text", "primaryKey": false, "notNull": false }, "transaction_status": { "name": "transaction_status", "type": "text", "primaryKey": false, "notNull": false }, "stripe_payment_id": { "name": "stripe_payment_id", "type": "text", "primaryKey": false, "notNull": false }, "created_on": { "name": "created_on", "type": "bigint", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "payment_transactions_lease_id_leases_id_fk": { "name": "payment_transactions_lease_id_leases_id_fk", "tableFrom": "payment_transactions", "tableTo": "leases", "columnsFrom": [ "lease_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.properties": { "name": "properties", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "title": { "name": "title", "type": "text", "primaryKey": false, "notNull": false }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": false }, "address_1": { "name": "address_1", "type": "text", "primaryKey": false, "notNull": false }, "address_2": { "name": "address_2", "type": "text", "primaryKey": false, "notNull": false }, "city": { "name": "city", "type": "text", "primaryKey": false, "notNull": false }, "state": { "name": "state", "type": "text", "primaryKey": false, "notNull": false }, "zip": { "name": "zip", "type": "text", "primaryKey": false, "notNull": false }, "country": { "name": "country", "type": "text", "primaryKey": false, "notNull": false }, "bedrooms": { "name": "bedrooms", "type": "integer", "primaryKey": false, "notNull": false }, "bathrooms": { "name": "bathrooms", "type": "integer", "primaryKey": false, "notNull": false }, "square_footage": { "name": "square_footage", "type": "integer", "primaryKey": false, "notNull": false }, "lot_size": { "name": "lot_size", "type": "integer", "primaryKey": false, "notNull": false }, "year_built": { "name": "year_built", "type": "integer", "primaryKey": false, "notNull": false }, "price": { "name": "price", "type": "double precision", "primaryKey": false, "notNull": false }, "property_type": { "name": "property_type", "type": "text", "primaryKey": false, "notNull": false }, "listing_status": { "name": "listing_status", "type": "text", "primaryKey": false, "notNull": false }, "rental_status": { "name": "rental_status", "type": "text", "primaryKey": false, "notNull": false }, "monthly_rent": { "name": "monthly_rent", "type": "double precision", "primaryKey": false, "notNull": false }, "security_deposit": { "name": "security_deposit", "type": "double precision", "primaryKey": false, "notNull": false }, "default_payment_method_id": { "name": "default_payment_method_id", "type": "text", "primaryKey": false, "notNull": false }, "lease_duration_months": { "name": "lease_duration_months", "type": "integer", "primaryKey": false, "notNull": false }, "amenities": { "name": "amenities", "type": "text", "primaryKey": false, "notNull": false }, "property_photos_count": { "name": "property_photos_count", "type": "integer", "primaryKey": false, "notNull": false, "default": 0 }, "image_url": { "name": "image_url", "type": "text", "primaryKey": false, "notNull": false }, "encrypted_data": { "name": "encrypted_data", "type": "text", "primaryKey": false, "notNull": false }, "created_on": { "name": "created_on", "type": "bigint", "primaryKey": false, "notNull": false }, "updated_on": { "name": "updated_on", "type": "bigint", "primaryKey": false, "notNull": false }, "owner_id": { "name": "owner_id", "type": "text", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "properties_default_payment_method_id_payment_methods_id_fk": { "name": "properties_default_payment_method_id_payment_methods_id_fk", "tableFrom": "properties", "tableTo": "payment_methods", "columnsFrom": [ "default_payment_method_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "properties_owner_id_users_id_fk": { "name": "properties_owner_id_users_id_fk", "tableFrom": "properties", "tableTo": "users", "columnsFrom": [ "owner_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.property_media": { "name": "property_media", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "property_id": { "name": "property_id", "type": "text", "primaryKey": false, "notNull": false }, "media_type": { "name": "media_type", "type": "text", "primaryKey": false, "notNull": false }, "file_url": { "name": "file_url", "type": "text", "primaryKey": false, "notNull": false }, "file_name": { "name": "file_name", "type": "text", "primaryKey": false, "notNull": false }, "display_order": { "name": "display_order", "type": "integer", "primaryKey": false, "notNull": false, "default": 0 }, "created_on": { "name": "created_on", "type": "bigint", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "property_media_property_id_properties_id_fk": { "name": "property_media_property_id_properties_id_fk", "tableFrom": "property_media", "tableTo": "properties", "columnsFrom": [ "property_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.reminders": { "name": "reminders", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": true }, "lease_id": { "name": "lease_id", "type": "text", "primaryKey": false, "notNull": false }, "reminder_type": { "name": "reminder_type", "type": "text", "primaryKey": false, "notNull": true }, "title": { "name": "title", "type": "text", "primaryKey": false, "notNull": true }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": false }, "due_date": { "name": "due_date", "type": "bigint", "primaryKey": false, "notNull": true }, "is_completed": { "name": "is_completed", "type": "boolean", "primaryKey": false, "notNull": false, "default": false }, "created_on": { "name": "created_on", "type": "bigint", "primaryKey": false, "notNull": false }, "updated_on": { "name": "updated_on", "type": "bigint", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "reminders_user_id_users_id_fk": { "name": "reminders_user_id_users_id_fk", "tableFrom": "reminders", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "reminders_lease_id_leases_id_fk": { "name": "reminders_lease_id_leases_id_fk", "tableFrom": "reminders", "tableTo": "leases", "columnsFrom": [ "lease_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.rent_schedules": { "name": "rent_schedules", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "property_id": { "name": "property_id", "type": "text", "primaryKey": false, "notNull": false }, "rent_amount": { "name": "rent_amount", "type": "double precision", "primaryKey": false, "notNull": false }, "due_day": { "name": "due_day", "type": "integer", "primaryKey": false, "notNull": false }, "late_fee_amount": { "name": "late_fee_amount", "type": "double precision", "primaryKey": false, "notNull": false }, "grace_period_days": { "name": "grace_period_days", "type": "integer", "primaryKey": false, "notNull": false, "default": 0 }, "payment_methods_allowed": { "name": "payment_methods_allowed", "type": "text", "primaryKey": false, "notNull": false }, "created_on": { "name": "created_on", "type": "bigint", "primaryKey": false, "notNull": false }, "updated_on": { "name": "updated_on", "type": "bigint", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "rent_schedules_property_id_properties_id_fk": { "name": "rent_schedules_property_id_properties_id_fk", "tableFrom": "rent_schedules", "tableTo": "properties", "columnsFrom": [ "property_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.roles": { "name": "roles", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.session_configs": { "name": "session_configs", "schema": "", "columns": { "device_id": { "name": "device_id", "type": "text", "primaryKey": true, "notNull": true }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": false }, "other_data": { "name": "other_data", "type": "text", "primaryKey": false, "notNull": false }, "active_date": { "name": "active_date", "type": "bigint", "primaryKey": false, "notNull": false }, "active_route": { "name": "active_route", "type": "text", "primaryKey": false, "notNull": false }, "page_data": { "name": "page_data", "type": "text", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "session_configs_user_id_users_id_fk": { "name": "session_configs_user_id_users_id_fk", "tableFrom": "session_configs", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.state_keys": { "name": "state_keys", "schema": "", "columns": { "seal_key": { "name": "seal_key", "type": "varchar(32)", "primaryKey": true, "notNull": true }, "state_id": { "name": "state_id", "type": "varchar(36)", "primaryKey": false, "notNull": true }, "cookie_hash": { "name": "cookie_hash", "type": "varchar(64)", "primaryKey": false, "notNull": true }, "created_on": { "name": "created_on", "type": "bigint", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.tenant_applications": { "name": "tenant_applications", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "property_id": { "name": "property_id", "type": "text", "primaryKey": false, "notNull": false }, "applicant_id": { "name": "applicant_id", "type": "text", "primaryKey": false, "notNull": false }, "application_status": { "name": "application_status", "type": "text", "primaryKey": false, "notNull": false }, "application_data_encrypted": { "name": "application_data_encrypted", "type": "text", "primaryKey": false, "notNull": false }, "document_urls_json": { "name": "document_urls_json", "type": "json", "primaryKey": false, "notNull": false }, "submitted_on": { "name": "submitted_on", "type": "bigint", "primaryKey": false, "notNull": false }, "reviewed_on": { "name": "reviewed_on", "type": "bigint", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "tenant_applications_property_id_properties_id_fk": { "name": "tenant_applications_property_id_properties_id_fk", "tableFrom": "tenant_applications", "tableTo": "properties", "columnsFrom": [ "property_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "tenant_applications_applicant_id_users_id_fk": { "name": "tenant_applications_applicant_id_users_id_fk", "tableFrom": "tenant_applications", "tableTo": "users", "columnsFrom": [ "applicant_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.tenant_invites": { "name": "tenant_invites", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "landlord_id": { "name": "landlord_id", "type": "text", "primaryKey": false, "notNull": false }, "property_id": { "name": "property_id", "type": "text", "primaryKey": false, "notNull": false }, "lease_id": { "name": "lease_id", "type": "text", "primaryKey": false, "notNull": false }, "available_on": { "name": "available_on", "type": "bigint", "primaryKey": false, "notNull": false }, "invited_emails": { "name": "invited_emails", "type": "text", "primaryKey": false, "notNull": false }, "created_on": { "name": "created_on", "type": "bigint", "primaryKey": false, "notNull": false }, "updated_on": { "name": "updated_on", "type": "bigint", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "tenant_invites_landlord_id_users_id_fk": { "name": "tenant_invites_landlord_id_users_id_fk", "tableFrom": "tenant_invites", "tableTo": "users", "columnsFrom": [ "landlord_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "tenant_invites_property_id_properties_id_fk": { "name": "tenant_invites_property_id_properties_id_fk", "tableFrom": "tenant_invites", "tableTo": "properties", "columnsFrom": [ "property_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "tenant_invites_lease_id_leases_id_fk": { "name": "tenant_invites_lease_id_leases_id_fk", "tableFrom": "tenant_invites", "tableTo": "leases", "columnsFrom": [ "lease_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.user_roles": { "name": "user_roles", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": false }, "role_id": { "name": "role_id", "type": "text", "primaryKey": false, "notNull": false }, "created_on": { "name": "created_on", "type": "bigint", "primaryKey": false, "notNull": false }, "updated_on": { "name": "updated_on", "type": "bigint", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "user_roles_user_id_users_id_fk": { "name": "user_roles_user_id_users_id_fk", "tableFrom": "user_roles", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "user_roles_role_id_roles_id_fk": { "name": "user_roles_role_id_roles_id_fk", "tableFrom": "user_roles", "tableTo": "roles", "columnsFrom": [ "role_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.user_tokens": { "name": "user_tokens", "schema": "", "columns": { "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": true }, "state_id": { "name": "state_id", "type": "text", "primaryKey": false, "notNull": true }, "access_token": { "name": "access_token", "type": "text", "primaryKey": false, "notNull": true }, "refresh_token": { "name": "refresh_token", "type": "text", "primaryKey": false, "notNull": true }, "created_on": { "name": "created_on", "type": "bigint", "primaryKey": false, "notNull": false }, "updated_on": { "name": "updated_on", "type": "bigint", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "user_tokens_user_id_users_id_fk": { "name": "user_tokens_user_id_users_id_fk", "tableFrom": "user_tokens", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": { "user_tokens_pkey": { "name": "user_tokens_pkey", "columns": [ "user_id", "state_id" ] } }, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.user_pins": { "name": "user_pins", "schema": "", "columns": { "user_id": { "name": "user_id", "type": "text", "primaryKey": true, "notNull": true }, "pin": { "name": "pin", "type": "text", "primaryKey": false, "notNull": true }, "created_on": { "name": "created_on", "type": "bigint", "primaryKey": false, "notNull": true }, "modified_on": { "name": "modified_on", "type": "bigint", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": { "user_pins_user_id_users_id_fk": { "name": "user_pins_user_id_users_id_fk", "tableFrom": "user_pins", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.users": { "name": "users", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": false }, "email": { "name": "email", "type": "text", "primaryKey": false, "notNull": false }, "phone": { "name": "phone", "type": "text", "primaryKey": false, "notNull": false }, "address_1": { "name": "address_1", "type": "text", "primaryKey": false, "notNull": false }, "address_2": { "name": "address_2", "type": "text", "primaryKey": false, "notNull": false }, "city": { "name": "city", "type": "text", "primaryKey": false, "notNull": false }, "state": { "name": "state", "type": "text", "primaryKey": false, "notNull": false }, "zip": { "name": "zip", "type": "text", "primaryKey": false, "notNull": false }, "country": { "name": "country", "type": "text", "primaryKey": false, "notNull": false }, "user_type": { "name": "user_type", "type": "text", "primaryKey": false, "notNull": false }, "onboarded_landlord": { "name": "onboarded_landlord", "type": "boolean", "primaryKey": false, "notNull": false, "default": false }, "onboarded_tenant": { "name": "onboarded_tenant", "type": "boolean", "primaryKey": false, "notNull": false, "default": false }, "email_verified": { "name": "email_verified", "type": "boolean", "primaryKey": false, "notNull": false, "default": false }, "banking_setup_complete": { "name": "banking_setup_complete", "type": "boolean", "primaryKey": false, "notNull": false, "default": false }, "notification_preferences_json": { "name": "notification_preferences_json", "type": "json", "primaryKey": false, "notNull": false }, "payment_preferences_json": { "name": "payment_preferences_json", "type": "json", "primaryKey": false, "notNull": false }, "onboarding_step": { "name": "onboarding_step", "type": "integer", "primaryKey": false, "notNull": false, "default": 0 }, "encrypted_data": { "name": "encrypted_data", "type": "text", "primaryKey": false, "notNull": false }, "started_on": { "name": "started_on", "type": "bigint", "primaryKey": false, "notNull": false }, "updated_on": { "name": "updated_on", "type": "bigint", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.web_tokens": { "name": "web_tokens", "schema": "", "columns": { "token_id": { "name": "token_id", "type": "varchar(64)", "primaryKey": true, "notNull": true }, "state_id": { "name": "state_id", "type": "varchar(36)", "primaryKey": false, "notNull": true }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": true }, "token_type": { "name": "token_type", "type": "text", "primaryKey": false, "notNull": true }, "token_value": { "name": "token_value", "type": "text", "primaryKey": false, "notNull": true }, "expires_on": { "name": "expires_on", "type": "bigint", "primaryKey": false, "notNull": true }, "created_on": { "name": "created_on", "type": "bigint", "primaryKey": false, "notNull": true }, "updated_on": { "name": "updated_on", "type": "bigint", "primaryKey": false, "notNull": true }, "last_used_on": { "name": "last_used_on", "type": "bigint", "primaryKey": false, "notNull": false }, "is_active": { "name": "is_active", "type": "boolean", "primaryKey": false, "notNull": false, "default": true }, "metadata": { "name": "metadata", "type": "json", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "web_tokens_user_id_users_id_fk": { "name": "web_tokens_user_id_users_id_fk", "tableFrom": "web_tokens", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false } }, "enums": {}, "schemas": {}, "sequences": {}, "roles": {}, "policies": {}, "views": {}, "_meta": { "columns": {}, "schemas": {}, "tables": {} } }