mirror of
https://github.com/msitarzewski/agency-agents.git
synced 2026-11-18 18:03:47 +00:00
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:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user