{ "version": "6", "dialect": "sqlite", "id": "920607a3-a577-410d-8f64-09c06df33a61", "prevId": "00000000-0000-0000-0000-000000000000", "tables": { "address_areas": { "name": "address_areas", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "place_name": { "name": "place_name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "zone_id": { "name": "zone_id", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": {}, "foreignKeys": { "address_areas_zone_id_address_zones_id_fk": { "name": "address_areas_zone_id_address_zones_id_fk", "tableFrom": "address_areas", "tableTo": "address_zones", "columnsFrom": [ "zone_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "address_zones": { "name": "address_zones", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "zone_name": { "name": "zone_name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "added_at": { "name": "added_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "addresses": { "name": "addresses", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "user_id": { "name": "user_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "phone": { "name": "phone", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "address_line1": { "name": "address_line1", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "address_line2": { "name": "address_line2", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "city": { "name": "city", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "state": { "name": "state", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "pincode": { "name": "pincode", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "is_default": { "name": "is_default", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "latitude": { "name": "latitude", "type": "real", "primaryKey": false, "notNull": false, "autoincrement": false }, "longitude": { "name": "longitude", "type": "real", "primaryKey": false, "notNull": false, "autoincrement": false }, "google_maps_url": { "name": "google_maps_url", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "admin_latitude": { "name": "admin_latitude", "type": "real", "primaryKey": false, "notNull": false, "autoincrement": false }, "admin_longitude": { "name": "admin_longitude", "type": "real", "primaryKey": false, "notNull": false, "autoincrement": false }, "zone_id": { "name": "zone_id", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": {}, "foreignKeys": { "addresses_user_id_users_id_fk": { "name": "addresses_user_id_users_id_fk", "tableFrom": "addresses", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "addresses_zone_id_address_zones_id_fk": { "name": "addresses_zone_id_address_zones_id_fk", "tableFrom": "addresses", "tableTo": "address_zones", "columnsFrom": [ "zone_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "cart_items": { "name": "cart_items", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "user_id": { "name": "user_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "product_id": { "name": "product_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "quantity": { "name": "quantity", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "added_at": { "name": "added_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": { "unique_user_product": { "name": "unique_user_product", "columns": [ "user_id", "product_id" ], "isUnique": true } }, "foreignKeys": { "cart_items_user_id_users_id_fk": { "name": "cart_items_user_id_users_id_fk", "tableFrom": "cart_items", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "cart_items_product_id_product_info_id_fk": { "name": "cart_items_product_id_product_info_id_fk", "tableFrom": "cart_items", "tableTo": "product_info", "columnsFrom": [ "product_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "complaints": { "name": "complaints", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "user_id": { "name": "user_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "order_id": { "name": "order_id", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "complaint_body": { "name": "complaint_body", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "images": { "name": "images", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "response": { "name": "response", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "is_resolved": { "name": "is_resolved", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": {}, "foreignKeys": { "complaints_user_id_users_id_fk": { "name": "complaints_user_id_users_id_fk", "tableFrom": "complaints", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "complaints_order_id_orders_id_fk": { "name": "complaints_order_id_orders_id_fk", "tableFrom": "complaints", "tableTo": "orders", "columnsFrom": [ "order_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "coupon_applicable_products": { "name": "coupon_applicable_products", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "coupon_id": { "name": "coupon_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "product_id": { "name": "product_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "unique_coupon_product": { "name": "unique_coupon_product", "columns": [ "coupon_id", "product_id" ], "isUnique": true } }, "foreignKeys": { "coupon_applicable_products_coupon_id_coupons_id_fk": { "name": "coupon_applicable_products_coupon_id_coupons_id_fk", "tableFrom": "coupon_applicable_products", "tableTo": "coupons", "columnsFrom": [ "coupon_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "coupon_applicable_products_product_id_product_info_id_fk": { "name": "coupon_applicable_products_product_id_product_info_id_fk", "tableFrom": "coupon_applicable_products", "tableTo": "product_info", "columnsFrom": [ "product_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "coupon_applicable_users": { "name": "coupon_applicable_users", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "coupon_id": { "name": "coupon_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "user_id": { "name": "user_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "unique_coupon_user": { "name": "unique_coupon_user", "columns": [ "coupon_id", "user_id" ], "isUnique": true } }, "foreignKeys": { "coupon_applicable_users_coupon_id_coupons_id_fk": { "name": "coupon_applicable_users_coupon_id_coupons_id_fk", "tableFrom": "coupon_applicable_users", "tableTo": "coupons", "columnsFrom": [ "coupon_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "coupon_applicable_users_user_id_users_id_fk": { "name": "coupon_applicable_users_user_id_users_id_fk", "tableFrom": "coupon_applicable_users", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "coupon_usage": { "name": "coupon_usage", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "user_id": { "name": "user_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "coupon_id": { "name": "coupon_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "order_id": { "name": "order_id", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "order_item_id": { "name": "order_item_id", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "used_at": { "name": "used_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": {}, "foreignKeys": { "coupon_usage_user_id_users_id_fk": { "name": "coupon_usage_user_id_users_id_fk", "tableFrom": "coupon_usage", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "coupon_usage_coupon_id_coupons_id_fk": { "name": "coupon_usage_coupon_id_coupons_id_fk", "tableFrom": "coupon_usage", "tableTo": "coupons", "columnsFrom": [ "coupon_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "coupon_usage_order_id_orders_id_fk": { "name": "coupon_usage_order_id_orders_id_fk", "tableFrom": "coupon_usage", "tableTo": "orders", "columnsFrom": [ "order_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "coupon_usage_order_item_id_order_items_id_fk": { "name": "coupon_usage_order_item_id_order_items_id_fk", "tableFrom": "coupon_usage", "tableTo": "order_items", "columnsFrom": [ "order_item_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "coupons": { "name": "coupons", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "coupon_code": { "name": "coupon_code", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "is_user_based": { "name": "is_user_based", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "discount_percent": { "name": "discount_percent", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "flat_discount": { "name": "flat_discount", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "min_order": { "name": "min_order", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "product_ids": { "name": "product_ids", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_by": { "name": "created_by", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "max_value": { "name": "max_value", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "is_apply_for_all": { "name": "is_apply_for_all", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "valid_till": { "name": "valid_till", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "max_limit_for_user": { "name": "max_limit_for_user", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "is_invalidated": { "name": "is_invalidated", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "exclusive_apply": { "name": "exclusive_apply", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": { "unique_coupon_code": { "name": "unique_coupon_code", "columns": [ "coupon_code" ], "isUnique": true } }, "foreignKeys": { "coupons_created_by_staff_users_id_fk": { "name": "coupons_created_by_staff_users_id_fk", "tableFrom": "coupons", "tableTo": "staff_users", "columnsFrom": [ "created_by" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "delivery_slot_info": { "name": "delivery_slot_info", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "delivery_time": { "name": "delivery_time", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "freeze_time": { "name": "freeze_time", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "is_active": { "name": "is_active", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": true }, "is_flash": { "name": "is_flash", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "is_capacity_full": { "name": "is_capacity_full", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "delivery_sequence": { "name": "delivery_sequence", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false, "default": "'{}'" }, "group_ids": { "name": "group_ids", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false, "default": "'[]'" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "home_banners": { "name": "home_banners", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "image_url": { "name": "image_url", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "product_ids": { "name": "product_ids", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "redirect_url": { "name": "redirect_url", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "serial_num": { "name": "serial_num", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "is_active": { "name": "is_active", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" }, "last_updated": { "name": "last_updated", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "key_val_store": { "name": "key_val_store", "columns": { "key": { "name": "key", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "value": { "name": "value", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "notif_creds": { "name": "notif_creds", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "token": { "name": "token", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "added_at": { "name": "added_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" }, "user_id": { "name": "user_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "last_verified": { "name": "last_verified", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": { "notif_creds_token_unique": { "name": "notif_creds_token_unique", "columns": [ "token" ], "isUnique": true } }, "foreignKeys": { "notif_creds_user_id_users_id_fk": { "name": "notif_creds_user_id_users_id_fk", "tableFrom": "notif_creds", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "notifications": { "name": "notifications", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "user_id": { "name": "user_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "title": { "name": "title", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "body": { "name": "body", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "type": { "name": "type", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "is_read": { "name": "is_read", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": {}, "foreignKeys": { "notifications_user_id_users_id_fk": { "name": "notifications_user_id_users_id_fk", "tableFrom": "notifications", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "order_items": { "name": "order_items", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "order_id": { "name": "order_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "product_id": { "name": "product_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "quantity": { "name": "quantity", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "price": { "name": "price", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "discounted_price": { "name": "discounted_price", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "is_packaged": { "name": "is_packaged", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "is_package_verified": { "name": "is_package_verified", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false } }, "indexes": {}, "foreignKeys": { "order_items_order_id_orders_id_fk": { "name": "order_items_order_id_orders_id_fk", "tableFrom": "order_items", "tableTo": "orders", "columnsFrom": [ "order_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "order_items_product_id_product_info_id_fk": { "name": "order_items_product_id_product_info_id_fk", "tableFrom": "order_items", "tableTo": "product_info", "columnsFrom": [ "product_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "order_status": { "name": "order_status", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "order_time": { "name": "order_time", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" }, "user_id": { "name": "user_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "order_id": { "name": "order_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "is_packaged": { "name": "is_packaged", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "is_delivered": { "name": "is_delivered", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "is_cancelled": { "name": "is_cancelled", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "cancel_reason": { "name": "cancel_reason", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "is_cancelled_by_admin": { "name": "is_cancelled_by_admin", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "payment_state": { "name": "payment_state", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'pending'" }, "cancellation_user_notes": { "name": "cancellation_user_notes", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "cancellation_admin_notes": { "name": "cancellation_admin_notes", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "cancellation_reviewed": { "name": "cancellation_reviewed", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "cancellation_reviewed_at": { "name": "cancellation_reviewed_at", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "refund_coupon_id": { "name": "refund_coupon_id", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": {}, "foreignKeys": { "order_status_user_id_users_id_fk": { "name": "order_status_user_id_users_id_fk", "tableFrom": "order_status", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "order_status_order_id_orders_id_fk": { "name": "order_status_order_id_orders_id_fk", "tableFrom": "order_status", "tableTo": "orders", "columnsFrom": [ "order_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "order_status_refund_coupon_id_coupons_id_fk": { "name": "order_status_refund_coupon_id_coupons_id_fk", "tableFrom": "order_status", "tableTo": "coupons", "columnsFrom": [ "refund_coupon_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "orders": { "name": "orders", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "user_id": { "name": "user_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "address_id": { "name": "address_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "slot_id": { "name": "slot_id", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "is_cod": { "name": "is_cod", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "is_online_payment": { "name": "is_online_payment", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "payment_info_id": { "name": "payment_info_id", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "total_amount": { "name": "total_amount", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "delivery_charge": { "name": "delivery_charge", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'0'" }, "readable_id": { "name": "readable_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "admin_notes": { "name": "admin_notes", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "user_notes": { "name": "user_notes", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "order_group_id": { "name": "order_group_id", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "order_group_proportion": { "name": "order_group_proportion", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "is_flash_delivery": { "name": "is_flash_delivery", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": {}, "foreignKeys": { "orders_user_id_users_id_fk": { "name": "orders_user_id_users_id_fk", "tableFrom": "orders", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "orders_address_id_addresses_id_fk": { "name": "orders_address_id_addresses_id_fk", "tableFrom": "orders", "tableTo": "addresses", "columnsFrom": [ "address_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "orders_slot_id_delivery_slot_info_id_fk": { "name": "orders_slot_id_delivery_slot_info_id_fk", "tableFrom": "orders", "tableTo": "delivery_slot_info", "columnsFrom": [ "slot_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "orders_payment_info_id_payment_info_id_fk": { "name": "orders_payment_info_id_payment_info_id_fk", "tableFrom": "orders", "tableTo": "payment_info", "columnsFrom": [ "payment_info_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "payment_info": { "name": "payment_info", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "gateway": { "name": "gateway", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "order_id": { "name": "order_id", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "token": { "name": "token", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "merchant_order_id": { "name": "merchant_order_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "payload": { "name": "payload", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": { "payment_info_merchant_order_id_unique": { "name": "payment_info_merchant_order_id_unique", "columns": [ "merchant_order_id" ], "isUnique": true } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "payments": { "name": "payments", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "gateway": { "name": "gateway", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "order_id": { "name": "order_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "token": { "name": "token", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "merchant_order_id": { "name": "merchant_order_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "payload": { "name": "payload", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": { "payments_merchant_order_id_unique": { "name": "payments_merchant_order_id_unique", "columns": [ "merchant_order_id" ], "isUnique": true } }, "foreignKeys": { "payments_order_id_orders_id_fk": { "name": "payments_order_id_orders_id_fk", "tableFrom": "payments", "tableTo": "orders", "columnsFrom": [ "order_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "product_availability_schedules": { "name": "product_availability_schedules", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "time": { "name": "time", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "schedule_name": { "name": "schedule_name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "action": { "name": "action", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "product_ids": { "name": "product_ids", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'[]'" }, "group_ids": { "name": "group_ids", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'[]'" }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" }, "last_updated": { "name": "last_updated", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": { "product_availability_schedules_schedule_name_unique": { "name": "product_availability_schedules_schedule_name_unique", "columns": [ "schedule_name" ], "isUnique": true } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "product_categories": { "name": "product_categories", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "product_group_info": { "name": "product_group_info", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "group_name": { "name": "group_name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "product_group_membership": { "name": "product_group_membership", "columns": { "product_id": { "name": "product_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "group_id": { "name": "group_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "added_at": { "name": "added_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": { "product_group_membership_pk": { "name": "product_group_membership_pk", "columns": [ "product_id", "group_id" ], "isUnique": true } }, "foreignKeys": { "product_group_membership_product_id_product_info_id_fk": { "name": "product_group_membership_product_id_product_info_id_fk", "tableFrom": "product_group_membership", "tableTo": "product_info", "columnsFrom": [ "product_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "product_group_membership_group_id_product_group_info_id_fk": { "name": "product_group_membership_group_id_product_group_info_id_fk", "tableFrom": "product_group_membership", "tableTo": "product_group_info", "columnsFrom": [ "group_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "product_info": { "name": "product_info", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "short_description": { "name": "short_description", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "long_description": { "name": "long_description", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "unit_id": { "name": "unit_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "price": { "name": "price", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "market_price": { "name": "market_price", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "images": { "name": "images", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "is_out_of_stock": { "name": "is_out_of_stock", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "is_suspended": { "name": "is_suspended", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "is_flash_available": { "name": "is_flash_available", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "flash_price": { "name": "flash_price", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" }, "increment_step": { "name": "increment_step", "type": "real", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 1 }, "product_quantity": { "name": "product_quantity", "type": "real", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 1 }, "store_id": { "name": "store_id", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "scheduled_availability": { "name": "scheduled_availability", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": true } }, "indexes": {}, "foreignKeys": { "product_info_unit_id_units_id_fk": { "name": "product_info_unit_id_units_id_fk", "tableFrom": "product_info", "tableTo": "units", "columnsFrom": [ "unit_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "product_info_store_id_store_info_id_fk": { "name": "product_info_store_id_store_info_id_fk", "tableFrom": "product_info", "tableTo": "store_info", "columnsFrom": [ "store_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "product_reviews": { "name": "product_reviews", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "user_id": { "name": "user_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "product_id": { "name": "product_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "review_body": { "name": "review_body", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "image_urls": { "name": "image_urls", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false, "default": "'[]'" }, "review_time": { "name": "review_time", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" }, "ratings": { "name": "ratings", "type": "real", "primaryKey": false, "notNull": true, "autoincrement": false }, "admin_response": { "name": "admin_response", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "admin_response_images": { "name": "admin_response_images", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false, "default": "'[]'" } }, "indexes": {}, "foreignKeys": { "product_reviews_user_id_users_id_fk": { "name": "product_reviews_user_id_users_id_fk", "tableFrom": "product_reviews", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "product_reviews_product_id_product_info_id_fk": { "name": "product_reviews_product_id_product_info_id_fk", "tableFrom": "product_reviews", "tableTo": "product_info", "columnsFrom": [ "product_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": { "rating_check": { "name": "rating_check", "value": "\"product_reviews\".\"ratings\" >= 1 AND \"product_reviews\".\"ratings\" <= 5" } } }, "product_slots": { "name": "product_slots", "columns": { "product_id": { "name": "product_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "slot_id": { "name": "slot_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "product_slot_pk": { "name": "product_slot_pk", "columns": [ "product_id", "slot_id" ], "isUnique": true } }, "foreignKeys": { "product_slots_product_id_product_info_id_fk": { "name": "product_slots_product_id_product_info_id_fk", "tableFrom": "product_slots", "tableTo": "product_info", "columnsFrom": [ "product_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "product_slots_slot_id_delivery_slot_info_id_fk": { "name": "product_slots_slot_id_delivery_slot_info_id_fk", "tableFrom": "product_slots", "tableTo": "delivery_slot_info", "columnsFrom": [ "slot_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "product_tag_info": { "name": "product_tag_info", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "tag_name": { "name": "tag_name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "tag_description": { "name": "tag_description", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "image_url": { "name": "image_url", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "is_dashboard_tag": { "name": "is_dashboard_tag", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "related_stores": { "name": "related_stores", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false, "default": "'[]'" }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": { "product_tag_info_tag_name_unique": { "name": "product_tag_info_tag_name_unique", "columns": [ "tag_name" ], "isUnique": true } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "product_tags": { "name": "product_tags", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "product_id": { "name": "product_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "tag_id": { "name": "tag_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "assigned_at": { "name": "assigned_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": { "unique_product_tag": { "name": "unique_product_tag", "columns": [ "product_id", "tag_id" ], "isUnique": true } }, "foreignKeys": { "product_tags_product_id_product_info_id_fk": { "name": "product_tags_product_id_product_info_id_fk", "tableFrom": "product_tags", "tableTo": "product_info", "columnsFrom": [ "product_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "product_tags_tag_id_product_tag_info_id_fk": { "name": "product_tags_tag_id_product_tag_info_id_fk", "tableFrom": "product_tags", "tableTo": "product_tag_info", "columnsFrom": [ "tag_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "refunds": { "name": "refunds", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "order_id": { "name": "order_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "refund_amount": { "name": "refund_amount", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "refund_status": { "name": "refund_status", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false, "default": "'none'" }, "merchant_refund_id": { "name": "merchant_refund_id", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "refund_processed_at": { "name": "refund_processed_at", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": {}, "foreignKeys": { "refunds_order_id_orders_id_fk": { "name": "refunds_order_id_orders_id_fk", "tableFrom": "refunds", "tableTo": "orders", "columnsFrom": [ "order_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "reserved_coupons": { "name": "reserved_coupons", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "secret_code": { "name": "secret_code", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "coupon_code": { "name": "coupon_code", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "discount_percent": { "name": "discount_percent", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "flat_discount": { "name": "flat_discount", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "min_order": { "name": "min_order", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "product_ids": { "name": "product_ids", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "max_value": { "name": "max_value", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "valid_till": { "name": "valid_till", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "max_limit_for_user": { "name": "max_limit_for_user", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "exclusive_apply": { "name": "exclusive_apply", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "is_redeemed": { "name": "is_redeemed", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "redeemed_by": { "name": "redeemed_by", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "redeemed_at": { "name": "redeemed_at", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_by": { "name": "created_by", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": { "reserved_coupons_secret_code_unique": { "name": "reserved_coupons_secret_code_unique", "columns": [ "secret_code" ], "isUnique": true }, "unique_secret_code": { "name": "unique_secret_code", "columns": [ "secret_code" ], "isUnique": true } }, "foreignKeys": { "reserved_coupons_redeemed_by_users_id_fk": { "name": "reserved_coupons_redeemed_by_users_id_fk", "tableFrom": "reserved_coupons", "tableTo": "users", "columnsFrom": [ "redeemed_by" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "reserved_coupons_created_by_staff_users_id_fk": { "name": "reserved_coupons_created_by_staff_users_id_fk", "tableFrom": "reserved_coupons", "tableTo": "staff_users", "columnsFrom": [ "created_by" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "special_deals": { "name": "special_deals", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "product_id": { "name": "product_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "quantity": { "name": "quantity", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "price": { "name": "price", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "valid_till": { "name": "valid_till", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": {}, "foreignKeys": { "special_deals_product_id_product_info_id_fk": { "name": "special_deals_product_id_product_info_id_fk", "tableFrom": "special_deals", "tableTo": "product_info", "columnsFrom": [ "product_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "staff_permissions": { "name": "staff_permissions", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "permission_name": { "name": "permission_name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": { "unique_permission_name": { "name": "unique_permission_name", "columns": [ "permission_name" ], "isUnique": true } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "staff_role_permissions": { "name": "staff_role_permissions", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "staff_role_id": { "name": "staff_role_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "staff_permission_id": { "name": "staff_permission_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": { "unique_role_permission": { "name": "unique_role_permission", "columns": [ "staff_role_id", "staff_permission_id" ], "isUnique": true } }, "foreignKeys": { "staff_role_permissions_staff_role_id_staff_roles_id_fk": { "name": "staff_role_permissions_staff_role_id_staff_roles_id_fk", "tableFrom": "staff_role_permissions", "tableTo": "staff_roles", "columnsFrom": [ "staff_role_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "staff_role_permissions_staff_permission_id_staff_permissions_id_fk": { "name": "staff_role_permissions_staff_permission_id_staff_permissions_id_fk", "tableFrom": "staff_role_permissions", "tableTo": "staff_permissions", "columnsFrom": [ "staff_permission_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "staff_roles": { "name": "staff_roles", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "role_name": { "name": "role_name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": { "unique_role_name": { "name": "unique_role_name", "columns": [ "role_name" ], "isUnique": true } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "staff_users": { "name": "staff_users", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "password": { "name": "password", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "staff_role_id": { "name": "staff_role_id", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": {}, "foreignKeys": { "staff_users_staff_role_id_staff_roles_id_fk": { "name": "staff_users_staff_role_id_staff_roles_id_fk", "tableFrom": "staff_users", "tableTo": "staff_roles", "columnsFrom": [ "staff_role_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "store_info": { "name": "store_info", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "image_url": { "name": "image_url", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" }, "owner": { "name": "owner", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": {}, "foreignKeys": { "store_info_owner_staff_users_id_fk": { "name": "store_info_owner_staff_users_id_fk", "tableFrom": "store_info", "tableTo": "staff_users", "columnsFrom": [ "owner" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "units": { "name": "units", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "short_notation": { "name": "short_notation", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "full_name": { "name": "full_name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "unique_short_notation": { "name": "unique_short_notation", "columns": [ "short_notation" ], "isUnique": true } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "unlogged_user_tokens": { "name": "unlogged_user_tokens", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "token": { "name": "token", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "added_at": { "name": "added_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" }, "last_verified": { "name": "last_verified", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": { "unlogged_user_tokens_token_unique": { "name": "unlogged_user_tokens_token_unique", "columns": [ "token" ], "isUnique": true } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "upload_url_status": { "name": "upload_url_status", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" }, "key": { "name": "key", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'pending'" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "user_creds": { "name": "user_creds", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "user_id": { "name": "user_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "user_password": { "name": "user_password", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": {}, "foreignKeys": { "user_creds_user_id_users_id_fk": { "name": "user_creds_user_id_users_id_fk", "tableFrom": "user_creds", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "user_details": { "name": "user_details", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "user_id": { "name": "user_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "bio": { "name": "bio", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "date_of_birth": { "name": "date_of_birth", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "gender": { "name": "gender", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "occupation": { "name": "occupation", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "profile_image": { "name": "profile_image", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "is_suspended": { "name": "is_suspended", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" }, "updated_at": { "name": "updated_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": { "user_details_user_id_unique": { "name": "user_details_user_id_unique", "columns": [ "user_id" ], "isUnique": true } }, "foreignKeys": { "user_details_user_id_users_id_fk": { "name": "user_details_user_id_users_id_fk", "tableFrom": "user_details", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "user_incidents": { "name": "user_incidents", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "user_id": { "name": "user_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "order_id": { "name": "order_id", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "date_added": { "name": "date_added", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" }, "admin_comment": { "name": "admin_comment", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "added_by": { "name": "added_by", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "negativity_score": { "name": "negativity_score", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": {}, "foreignKeys": { "user_incidents_user_id_users_id_fk": { "name": "user_incidents_user_id_users_id_fk", "tableFrom": "user_incidents", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "user_incidents_order_id_orders_id_fk": { "name": "user_incidents_order_id_orders_id_fk", "tableFrom": "user_incidents", "tableTo": "orders", "columnsFrom": [ "order_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "user_incidents_added_by_staff_users_id_fk": { "name": "user_incidents_added_by_staff_users_id_fk", "tableFrom": "user_incidents", "tableTo": "staff_users", "columnsFrom": [ "added_by" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "user_notifications": { "name": "user_notifications", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "title": { "name": "title", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "image_url": { "name": "image_url", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" }, "body": { "name": "body", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "applicable_users": { "name": "applicable_users", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "users": { "name": "users", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "email": { "name": "email", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "mobile": { "name": "mobile", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": { "unique_email": { "name": "unique_email", "columns": [ "email" ], "isUnique": true } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "vendor_snippets": { "name": "vendor_snippets", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "snippet_code": { "name": "snippet_code", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "slot_id": { "name": "slot_id", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "is_permanent": { "name": "is_permanent", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "product_ids": { "name": "product_ids", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "valid_till": { "name": "valid_till", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "(strftime('%s','now'))" } }, "indexes": { "vendor_snippets_snippet_code_unique": { "name": "vendor_snippets_snippet_code_unique", "columns": [ "snippet_code" ], "isUnique": true } }, "foreignKeys": { "vendor_snippets_slot_id_delivery_slot_info_id_fk": { "name": "vendor_snippets_slot_id_delivery_slot_info_id_fk", "tableFrom": "vendor_snippets", "tableTo": "delivery_slot_info", "columnsFrom": [ "slot_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} } }, "views": {}, "enums": {}, "_meta": { "schemas": {}, "tables": {}, "columns": {} }, "internal": { "indexes": {} } }