▦ HSE/CMMS Database Explorer

Visualize tables · Inspect relationships · Generate SQL queries
0TABLES
0RELATIONSHIPS
11ENUM TYPES
SQLQUERY BUILDER

Database tables

0

Schema visualization

Click any table
SQL query builder
Generated from selected table metadata. Review before running.
Preview only: this standalone HTML does not connect to your database or execute SQL.

Bulk Upload Roadmap

See how a CSV/XLSX upload becomes validated HSE master records — from file selection to row-level results.

1
Choose moduleSelect Protocol, Area, Department, Training, or Incident Form.
2
Upload fileAccept CSV/XLSX, check file type and size, store original file.
3
Map columnsMatch spreadsheet headers to database fields and normalize values.
4
Validate rowsCheck required fields, enum values, duplicates and foreign keys.
5
Import safelyProcess rows in transactions and log each result in bulk upload rows.
6
Download reportShow totals and download failed rows with a reason column.
Upload configurationReady
⇧CSV/XLSX upload stepDemo uses sample rows; no file is sent to a server.
Production tables: sw_cmms_hse_bulk_upload_job stores job status and totals; sw_cmms_hse_bulk_upload_row stores each row's success/failure and reason.
Row validation preview0 rows
RowSample dataValidationResult
Click “Play bulk upload demo” or “Validate sample rows”.
Processing log
Waiting for demo to start…

End-to-end HSE/CMMS workflow

Database design + dynamic form builder + submissions + bulk imports
Interactive roadmap
Select a workflow tab or play the steps to see how the database, form builder, and user submission connect.
HSE / CMMS · DYNAMIC FORM ARCHITECTURE

From Form Designer to Database

See exactly what gets stored, when SQL is generated, which API endpoints are called, and whether a physical table is created.

⛁↔▤
Recommended architecture: creating a form normally inserts metadata into shared form-definition tables. It does not create a new MySQL table for every form. Submissions are stored in shared submission/value tables. The optional physical-table strategy is shown separately because it needs extra schema migration and security controls.

Interactive implementation roadmap

Click any step or use Play to trace the lifecycle.

01 · Configure the form

Admin defines form title, sections, fields, options, validation and data-source rules.

DESIGN

▤ Example form definition

⌘ Generated request payload

{
  "title": "Incident Report",
  "sections": [{
    "title": "Incident Details",
    "fields": [{
      "field_key": "incident_date",
      "field_label": "Incident date",
      "field_type": "date",
      "is_required": true
    }]
  }]
}

▥ Database write / SQL plan

BEGIN;
INSERT INTO sw_cmms_hse_master_incident_form (...);
INSERT INTO sw_cmms_hse_master_incident_form_section (...);
INSERT INTO sw_cmms_hse_master_incident_form_field (...);
COMMIT;

Illustrative SQL only. In production, use parameterized Laravel queries/Eloquent and a transaction.

Database storage map

Which table receives data at each step?

Form metadatasw_cmms_hse_master_incident_formTitle, status, code, owner
Sections + fields..._form_section..._form_fieldField types, required rules, options
Published versionsw_cmms_hse_incident_form_versionImmutable schema snapshot
Submission mastersw_cmms_hse_incident_form_submissionWho submitted, form version, status
Field answers..._submission_value
File metadata..._attachment
Audit historysw_cmms_hse_incident_form_auditPublish, submit, review events

When is a physical table created?

Choose the intended storage strategy

No dynamic DDL is needed when using the shared-table design. The “generated query” means parameterized INSERT/UPDATE statements against existing tables.

Submission transaction · request to commit

Illustrative order of operations when an employee submits a generated form

TRANSACTION
1POST answers/api/hse/forms/{id}/submissionsJSON answers + uploaded files
2Load versionFormVersion::where(...)Verify published version and access
3ValidateValidator::make(...)Required/type/options/file limits
4Begin transactionDB::transaction(...)All database writes succeed or roll back
5Save valuessubmission + value rowsStore file paths separately
6Commit + respond201 CreatedReturn submission ID and status
Ready. Select a stage above to see its SQL plan, payload and endpoints.
HSE / CMMS · DATA IMPORT TOOLKIT

Bulk Upload Reference Templates

Download a CSV template for every supported bulk-upload module. Each template includes column headers and example rows where practical.

Before importing: Templates are based on the supplied HSE/CMMS schema and use header names as import keys. IDs and parent references should normally be resolved by the backend; do not invent UUIDs. XLSX is not generated here. “Download all CSVs” uses a small ZIP writer built into this HTML and does not require a library or internet connection.