{ "id": "8023ec5b-dd3f-4cdb-bf4c-f8f0b81f0a33", "prevId": "00000000-0000-0000-0000-000000000000", "version": "7", "dialect": "postgresql", "tables": { "public.admin_settings": { "name": "admin_settings", "schema": "", "columns": { "key": { "name": "key", "type": "text", "primaryKey": true, "notNull": true }, "value": { "name": "value", "type": "text", "primaryKey": false, "notNull": true }, "updated_at": { "name": "updated_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.cart_items": { "name": "cart_items", "schema": "", "columns": { "id": { "name": "id", "type": "serial", "primaryKey": true, "notNull": true }, "cart_id": { "name": "cart_id", "type": "integer", "primaryKey": false, "notNull": true }, "item_id": { "name": "item_id", "type": "integer", "primaryKey": false, "notNull": true }, "added_at": { "name": "added_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "expires_at": { "name": "expires_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true }, "last_reminder_sent_at": { "name": "last_reminder_sent_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "cart_items_cart_id_fkey": { "name": "cart_items_cart_id_fkey", "tableFrom": "cart_items", "tableTo": "carts", "columnsFrom": [ "cart_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "cart_items_item_id_fkey": { "name": "cart_items_item_id_fkey", "tableFrom": "cart_items", "tableTo": "items", "columnsFrom": [ "item_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "cart_items_item_id_key": { "name": "cart_items_item_id_key", "nullsNotDistinct": false, "columns": [ "item_id" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.carts": { "name": "carts", "schema": "", "columns": { "id": { "name": "id", "type": "serial", "primaryKey": true, "notNull": true }, "customer_id": { "name": "customer_id", "type": "integer", "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": {}, "foreignKeys": { "carts_customer_id_fkey": { "name": "carts_customer_id_fkey", "tableFrom": "carts", "tableTo": "customers", "columnsFrom": [ "customer_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "carts_customer_id_key": { "name": "carts_customer_id_key", "nullsNotDistinct": false, "columns": [ "customer_id" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.categories": { "name": "categories", "schema": "", "columns": { "id": { "name": "id", "type": "serial", "primaryKey": true, "notNull": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true }, "parent_id": { "name": "parent_id", "type": "integer", "primaryKey": false, "notNull": false }, "sort_order": { "name": "sort_order", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": { "categories_child_name_uniq": { "name": "categories_child_name_uniq", "columns": [ { "expression": "parent_id", "asc": true, "isExpression": true, "nulls": "last" }, { "expression": "lower(name)", "asc": true, "isExpression": true, "nulls": "last" } ], "isUnique": true, "where": "(parent_id IS NOT NULL)", "concurrently": false, "method": "btree", "with": {} }, "categories_parent_id_idx": { "name": "categories_parent_id_idx", "columns": [ { "expression": "parent_id", "isExpression": false, "asc": true, "nulls": "last", "opclass": "int4_ops" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} }, "categories_root_name_uniq": { "name": "categories_root_name_uniq", "columns": [ { "expression": "lower(name)", "asc": true, "isExpression": true, "nulls": "last" } ], "isUnique": true, "where": "(parent_id IS NULL)", "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "categories_parent_id_fkey": { "name": "categories_parent_id_fkey", "tableFrom": "categories", "tableTo": "categories", "columnsFrom": [ "parent_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.checkout_items": { "name": "checkout_items", "schema": "", "columns": { "checkout_id": { "name": "checkout_id", "type": "integer", "primaryKey": false, "notNull": true }, "item_id": { "name": "item_id", "type": "integer", "primaryKey": false, "notNull": true }, "price_cents": { "name": "price_cents", "type": "integer", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": { "checkout_items_checkout_id_fkey": { "name": "checkout_items_checkout_id_fkey", "tableFrom": "checkout_items", "tableTo": "checkouts", "columnsFrom": [ "checkout_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "checkout_items_item_id_fkey": { "name": "checkout_items_item_id_fkey", "tableFrom": "checkout_items", "tableTo": "items", "columnsFrom": [ "item_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": { "checkout_items_pkey": { "name": "checkout_items_pkey", "columns": [ "checkout_id", "item_id" ] } }, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.checkouts": { "name": "checkouts", "schema": "", "columns": { "id": { "name": "id", "type": "serial", "primaryKey": true, "notNull": true }, "customer_id": { "name": "customer_id", "type": "integer", "primaryKey": false, "notNull": false }, "shipping_address_id": { "name": "shipping_address_id", "type": "integer", "primaryKey": false, "notNull": false }, "processor": { "name": "processor", "type": "text", "primaryKey": false, "notNull": true }, "processor_order_id": { "name": "processor_order_id", "type": "text", "primaryKey": false, "notNull": false }, "amount_cents": { "name": "amount_cents", "type": "integer", "primaryKey": false, "notNull": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "default": "'pending'" }, "raw_event": { "name": "raw_event", "type": "jsonb", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": {}, "foreignKeys": { "checkouts_customer_id_fkey": { "name": "checkouts_customer_id_fkey", "tableFrom": "checkouts", "tableTo": "customers", "columnsFrom": [ "customer_id" ], "columnsTo": [ "id" ], "onDelete": "set null", "onUpdate": "no action" }, "checkouts_shipping_address_id_fkey": { "name": "checkouts_shipping_address_id_fkey", "tableFrom": "checkouts", "tableTo": "shipping_addresses", "columnsFrom": [ "shipping_address_id" ], "columnsTo": [ "id" ], "onDelete": "set null", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.customer_sessions": { "name": "customer_sessions", "schema": "", "columns": { "token": { "name": "token", "type": "text", "primaryKey": true, "notNull": true }, "customer_id": { "name": "customer_id", "type": "integer", "primaryKey": false, "notNull": true }, "expires_at": { "name": "expires_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": {}, "foreignKeys": { "customer_sessions_customer_id_fkey": { "name": "customer_sessions_customer_id_fkey", "tableFrom": "customer_sessions", "tableTo": "customers", "columnsFrom": [ "customer_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.customer_tokens": { "name": "customer_tokens", "schema": "", "columns": { "token": { "name": "token", "type": "text", "primaryKey": true, "notNull": true }, "customer_id": { "name": "customer_id", "type": "integer", "primaryKey": false, "notNull": true }, "kind": { "name": "kind", "type": "text", "primaryKey": false, "notNull": true }, "expires_at": { "name": "expires_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": {}, "foreignKeys": { "customer_tokens_customer_id_fkey": { "name": "customer_tokens_customer_id_fkey", "tableFrom": "customer_tokens", "tableTo": "customers", "columnsFrom": [ "customer_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.customers": { "name": "customers", "schema": "", "columns": { "id": { "name": "id", "type": "serial", "primaryKey": true, "notNull": true }, "email": { "name": "email", "type": "text", "primaryKey": false, "notNull": true }, "password_hash": { "name": "password_hash", "type": "text", "primaryKey": false, "notNull": true }, "email_verified": { "name": "email_verified", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "marketing_consent": { "name": "marketing_consent", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "marketing_consent_at": { "name": "marketing_consent_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "marketing_consent_text": { "name": "marketing_consent_text", "type": "text", "primaryKey": false, "notNull": false }, "unsubscribe_token": { "name": "unsubscribe_token", "type": "text", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "disabled_at": { "name": "disabled_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "favorite_alerts": { "name": "favorite_alerts", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "favorite_alerts_at": { "name": "favorite_alerts_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "favorite_alerts_text": { "name": "favorite_alerts_text", "type": "text", "primaryKey": false, "notNull": false }, "first_name": { "name": "first_name", "type": "text", "primaryKey": false, "notNull": false }, "last_name": { "name": "last_name", "type": "text", "primaryKey": false, "notNull": false } }, "indexes": { "customers_disabled_at_idx": { "name": "customers_disabled_at_idx", "columns": [ { "expression": "disabled_at", "isExpression": false, "asc": true, "nulls": "last", "opclass": "timestamptz_ops" } ], "isUnique": false, "where": "(disabled_at IS NOT NULL)", "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { "customers_email_key": { "name": "customers_email_key", "nullsNotDistinct": false, "columns": [ "email" ] }, "customers_unsubscribe_token_key": { "name": "customers_unsubscribe_token_key", "nullsNotDistinct": false, "columns": [ "unsubscribe_token" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.favorites": { "name": "favorites", "schema": "", "columns": { "customer_id": { "name": "customer_id", "type": "integer", "primaryKey": false, "notNull": true }, "item_id": { "name": "item_id", "type": "integer", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": { "favorites_item_id_idx": { "name": "favorites_item_id_idx", "columns": [ { "expression": "item_id", "isExpression": false, "asc": true, "nulls": "last", "opclass": "int4_ops" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "favorites_customer_id_fkey": { "name": "favorites_customer_id_fkey", "tableFrom": "favorites", "tableTo": "customers", "columnsFrom": [ "customer_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "favorites_item_id_fkey": { "name": "favorites_item_id_fkey", "tableFrom": "favorites", "tableTo": "items", "columnsFrom": [ "item_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": { "favorites_pkey": { "name": "favorites_pkey", "columns": [ "customer_id", "item_id" ] } }, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.item_images": { "name": "item_images", "schema": "", "columns": { "id": { "name": "id", "type": "serial", "primaryKey": true, "notNull": true }, "item_id": { "name": "item_id", "type": "integer", "primaryKey": false, "notNull": true }, "image_path": { "name": "image_path", "type": "text", "primaryKey": false, "notNull": true }, "sort_order": { "name": "sort_order", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": {}, "foreignKeys": { "item_images_item_id_fkey": { "name": "item_images_item_id_fkey", "tableFrom": "item_images", "tableTo": "items", "columnsFrom": [ "item_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.item_tags": { "name": "item_tags", "schema": "", "columns": { "item_id": { "name": "item_id", "type": "integer", "primaryKey": false, "notNull": true }, "tag_id": { "name": "tag_id", "type": "integer", "primaryKey": false, "notNull": true } }, "indexes": { "item_tags_tag_id_idx": { "name": "item_tags_tag_id_idx", "columns": [ { "expression": "tag_id", "isExpression": false, "asc": true, "nulls": "last", "opclass": "int4_ops" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "item_tags_item_id_fkey": { "name": "item_tags_item_id_fkey", "tableFrom": "item_tags", "tableTo": "items", "columnsFrom": [ "item_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "item_tags_tag_id_fkey": { "name": "item_tags_tag_id_fkey", "tableFrom": "item_tags", "tableTo": "tags", "columnsFrom": [ "tag_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": { "item_tags_pkey": { "name": "item_tags_pkey", "columns": [ "item_id", "tag_id" ] } }, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.items": { "name": "items", "schema": "", "columns": { "id": { "name": "id", "type": "serial", "primaryKey": true, "notNull": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": false }, "price_cents": { "name": "price_cents", "type": "integer", "primaryKey": false, "notNull": true }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "default": "'pending'" }, "reserved_until": { "name": "reserved_until", "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "sold_at": { "name": "sold_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "paypal_order_id": { "name": "paypal_order_id", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "category_id": { "name": "category_id", "type": "integer", "primaryKey": false, "notNull": false }, "condition_note": { "name": "condition_note", "type": "text", "primaryKey": false, "notNull": false } }, "indexes": { "items_category_id_idx": { "name": "items_category_id_idx", "columns": [ { "expression": "category_id", "isExpression": false, "asc": true, "nulls": "last", "opclass": "int4_ops" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "items_category_id_fkey": { "name": "items_category_id_fkey", "tableFrom": "items", "tableTo": "categories", "columnsFrom": [ "category_id" ], "columnsTo": [ "id" ], "onDelete": "set null", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.orders": { "name": "orders", "schema": "", "columns": { "id": { "name": "id", "type": "serial", "primaryKey": true, "notNull": true }, "item_id": { "name": "item_id", "type": "integer", "primaryKey": false, "notNull": false }, "customer_id": { "name": "customer_id", "type": "integer", "primaryKey": false, "notNull": false }, "checkout_id": { "name": "checkout_id", "type": "integer", "primaryKey": false, "notNull": false }, "processor": { "name": "processor", "type": "text", "primaryKey": false, "notNull": true }, "processor_order_id": { "name": "processor_order_id", "type": "text", "primaryKey": false, "notNull": false }, "amount_cents": { "name": "amount_cents", "type": "integer", "primaryKey": false, "notNull": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": false }, "raw_event": { "name": "raw_event", "type": "jsonb", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": {}, "foreignKeys": { "orders_item_id_fkey": { "name": "orders_item_id_fkey", "tableFrom": "orders", "tableTo": "items", "columnsFrom": [ "item_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "orders_customer_id_fkey": { "name": "orders_customer_id_fkey", "tableFrom": "orders", "tableTo": "customers", "columnsFrom": [ "customer_id" ], "columnsTo": [ "id" ], "onDelete": "set null", "onUpdate": "no action" }, "orders_checkout_id_fkey": { "name": "orders_checkout_id_fkey", "tableFrom": "orders", "tableTo": "checkouts", "columnsFrom": [ "checkout_id" ], "columnsTo": [ "id" ], "onDelete": "set null", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.pgmigrations": { "name": "pgmigrations", "schema": "", "columns": { "id": { "name": "id", "type": "serial", "primaryKey": true, "notNull": true }, "name": { "name": "name", "type": "varchar(255)", "primaryKey": false, "notNull": true }, "run_on": { "name": "run_on", "type": "timestamp", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.shipping_addresses": { "name": "shipping_addresses", "schema": "", "columns": { "id": { "name": "id", "type": "serial", "primaryKey": true, "notNull": true }, "customer_id": { "name": "customer_id", "type": "integer", "primaryKey": false, "notNull": true }, "full_name": { "name": "full_name", "type": "text", "primaryKey": false, "notNull": true }, "address_line1": { "name": "address_line1", "type": "text", "primaryKey": false, "notNull": true }, "address_line2": { "name": "address_line2", "type": "text", "primaryKey": false, "notNull": false }, "city": { "name": "city", "type": "text", "primaryKey": false, "notNull": true }, "state": { "name": "state", "type": "text", "primaryKey": false, "notNull": true }, "postal_code": { "name": "postal_code", "type": "text", "primaryKey": false, "notNull": true }, "country": { "name": "country", "type": "text", "primaryKey": false, "notNull": true, "default": "'US'" }, "is_default": { "name": "is_default", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "usps_validated": { "name": "usps_validated", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "usps_standardized": { "name": "usps_standardized", "type": "jsonb", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": {}, "foreignKeys": { "shipping_addresses_customer_id_fkey": { "name": "shipping_addresses_customer_id_fkey", "tableFrom": "shipping_addresses", "tableTo": "customers", "columnsFrom": [ "customer_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.tags": { "name": "tags", "schema": "", "columns": { "id": { "name": "id", "type": "serial", "primaryKey": true, "notNull": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true }, "color": { "name": "color", "type": "text", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": { "tags_name_uniq": { "name": "tags_name_uniq", "columns": [ { "expression": "lower(name)", "asc": true, "isExpression": true, "nulls": "last" } ], "isUnique": true, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false } }, "enums": {}, "schemas": {}, "sequences": {}, "roles": {}, "policies": {}, "views": {}, "_meta": { "columns": {}, "schemas": {}, "tables": {} } }