bagsy/apps/api/db/migrations/meta/0001_snapshot.json
bananabas 4fe4a98b1c feat: Migrate from self-hosted to Vercel + Neon + Clerk
- Move database from self-hosted Postgres to Neon (free tier)
- Replace better-auth with Clerk authentication (email/password + OAuth)
- Integrate Ably for real-time sync (replaces custom WebSocket)
- Remove passkey authentication (pending Apple Developer account)
- Add Clerk Organizations for household management
- Implement custom household join-code flow with Clerk
- Add secure Ably key fetching via backend API
- Update iOS app for Clerk auth and Ably real-time sync
- Configure Vercel deployment settings
- Update environment configuration for new infrastructure

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-06-27 18:59:00 +01:00

531 lines
No EOL
13 KiB
JSON

{
"id": "83a779e2-6624-4497-9622-aa949733f6cd",
"prevId": "db7e21fb-ece5-4aee-b587-82deabed69e6",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.aisles": {
"name": "aisles",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"store_id": {
"name": "store_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"order": {
"name": "order",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"colour": {
"name": "colour",
"type": "varchar(7)",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"aisles_store_id_stores_id_fk": {
"name": "aisles_store_id_stores_id_fk",
"tableFrom": "aisles",
"tableTo": "stores",
"columnsFrom": [
"store_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.household_invite_codes": {
"name": "household_invite_codes",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"household_id": {
"name": "household_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"code": {
"name": "code",
"type": "varchar(8)",
"primaryKey": false,
"notNull": true
},
"created_by": {
"name": "created_by",
"type": "uuid",
"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",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"household_invite_codes_code_unique": {
"name": "household_invite_codes_code_unique",
"nullsNotDistinct": false,
"columns": [
"code"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.items": {
"name": "items",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"household_id": {
"name": "household_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"barcode": {
"name": "barcode",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
"aisle_id": {
"name": "aisle_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"store_id": {
"name": "store_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"alternatives": {
"name": "alternatives",
"type": "json",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"items_aisle_id_aisles_id_fk": {
"name": "items_aisle_id_aisles_id_fk",
"tableFrom": "items",
"tableTo": "aisles",
"columnsFrom": [
"aisle_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"items_store_id_stores_id_fk": {
"name": "items_store_id_stores_id_fk",
"tableFrom": "items",
"tableTo": "stores",
"columnsFrom": [
"store_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.list_items": {
"name": "list_items",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"shopping_list_id": {
"name": "shopping_list_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"item_id": {
"name": "item_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"quantity": {
"name": "quantity",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 1
},
"checked": {
"name": "checked",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"added_by": {
"name": "added_by",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"excluded_from_preset": {
"name": "excluded_from_preset",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"list_items_shopping_list_id_shopping_lists_id_fk": {
"name": "list_items_shopping_list_id_shopping_lists_id_fk",
"tableFrom": "list_items",
"tableTo": "shopping_lists",
"columnsFrom": [
"shopping_list_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"list_items_item_id_items_id_fk": {
"name": "list_items_item_id_items_id_fk",
"tableFrom": "list_items",
"tableTo": "items",
"columnsFrom": [
"item_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.scan_history": {
"name": "scan_history",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"household_id": {
"name": "household_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"barcode": {
"name": "barcode",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"item_id": {
"name": "item_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"scanned_at": {
"name": "scanned_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"scan_history_item_id_items_id_fk": {
"name": "scan_history_item_id_items_id_fk",
"tableFrom": "scan_history",
"tableTo": "items",
"columnsFrom": [
"item_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.shopping_lists": {
"name": "shopping_lists",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"household_id": {
"name": "household_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"store_id": {
"name": "store_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"is_preset": {
"name": "is_preset",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"auto_reset": {
"name": "auto_reset",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"shopping_lists_store_id_stores_id_fk": {
"name": "shopping_lists_store_id_stores_id_fk",
"tableFrom": "shopping_lists",
"tableTo": "stores",
"columnsFrom": [
"store_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.stores": {
"name": "stores",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"household_id": {
"name": "household_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"location": {
"name": "location",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}