Skip to content

Code Table

Overview

Table for managing code information (components and pages)

Table Definition

Logical Name Physical Name Column Name Data Type Primary Key Relation Unique Nullable Default Value Remarks
Code Information code id string โ—ฏ Use UUID and store in DocumentDB _id
project_id number project:id
name string
image_url string Screenshot or preview image of the code entry
type number 0: page
1: component
based_on number 0: imported
1: design
2: wireframe
source_code string
css_code string โ—ฏ CSS may not exist
status number 0: Processing
1: Completed
2: Failed
created_at datetime
updated_at datetime
deleted_at datetime โ—ฏ
created_by string user:cognito_sub
updated_by string user:cognito_sub
deleted_by string user:cognito_sub โ—ฏ

Relations

  • project_id โ†’ project.id
  • created_by โ†’ user.cognito_sub
  • updated_by โ†’ user.cognito_sub
  • deleted_by โ†’ user.cognito_sub

Indexes

  • PRIMARY KEY (id)

Type Codes

  • 0: Page
  • 1: Component

Based On Codes

  • 0: Imported
  • 1: Design
  • 2: Wireframe

Status Codes

  • 0: Processing
  • 1: Completed
  • 2: Failed

Notes

  • ID uses UUID and is stored in DocumentDB _id field
  • image_url stores a screenshot or preview image of the code entry
  • type distinguishes between pages and components
  • based_on indicates the origin of the code
  • CSS is optional (nullable)
  • Logical deletion support (deleted_at column)
  • Audit log support (created_by, updated_by, deleted_by)