fix(backend-architect): define categories before products

Make the example schema runnable in an empty PostgreSQL database by defining the table referenced by products.category_id.
This commit is contained in:
ayobamiseun
2026-10-25 09:51:38 +01:00
parent 4e3ac3ca66
commit 89aea71a81
@@ -134,6 +134,12 @@ CREATE TABLE users (
CREATE INDEX idx_users_email ON users(email) WHERE deleted_at IS NULL;
CREATE INDEX idx_users_created_at ON users(created_at);
-- Categories must exist before products can reference them
CREATE TABLE categories (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name VARCHAR(255) NOT NULL
);
-- Products table with proper normalization
CREATE TABLE products (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),