// Complex test schema with relationships, indexes, and multiple schemas Table public.users { id bigint [pk, increment] email varchar(255) [unique, not null] username varchar(50) [not null] name varchar(100) bio text is_active boolean [default: true] created_at timestamp [not null] updated_at timestamp indexes { (email) [unique, name: 'idx_users_email'] (username, is_active) [name: 'idx_users_username_active'] } Note: 'User accounts table' } Table public.posts { id bigint [pk, increment] user_id bigint [not null] title varchar(200) [not null] slug varchar(250) [unique, not null] content text published boolean [default: false] view_count integer [default: 0] created_at timestamp [not null] updated_at timestamp indexes { (slug) [unique] (user_id, published) (created_at) [type: 'btree'] } } Table public.comments { id bigint [pk, increment] post_id bigint [not null] user_id bigint [not null] content text [not null] is_edited boolean [default: false] created_at timestamp [not null] updated_at timestamp } Table admin.audit_logs { id bigint [pk, increment] user_id bigint action varchar(100) [not null] entity_type varchar(50) entity_id bigint details jsonb created_at timestamp [not null] } // Relationships Ref: public.posts.user_id > public.users.id [ondelete: CASCADE, onupdate: CASCADE] Ref: public.comments.post_id > public.posts.id [ondelete: CASCADE] Ref: public.comments.user_id > public.users.id [ondelete: SET NULL] Ref: admin.audit_logs.user_id > public.users.id [ondelete: SET NULL]