Skip to content

[Bug]: SQL schema PIM tables do not match the multiplicities of the PIM model #412

Open

Description

@antoineatstariongroup

What type of issue is this?

  • Bug report
  • Feature request

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of the SysML2.NET
  • I have searched open and closed issues to ensure it has not already been reported

Description

The PIM section of the schema (schema.generated.sql:268-512) differs from the normative PIM model (ptc/25-02-29, Systems-Modeling-API.xmi):

PIM property Model Schema
Project::name, CommitReference::name, Query::name [1..1] (redefines Record::name) nullable
Record::description [1..1] nullable on every table
Project::defaultBranch [1..1] nullable
Commit::previousCommits unordered commit_parent.ordinal, comment at :272 says ordered
Record::alias [0..*] missing
Record::resourceIdentifier [0..1] on every Record only on project

CommitReference::deleted is [1..1] in the model, which cannot hold for a live branch; the nullable column is kept, and the discrepancy belongs to the specification.

The §3 banner of schema.generated.sql states that the C# PIM DTOs carry "a multi-valued ordered PreviousCommit". The C# types say otherwise (isOrdered: false), in line with the model.

Expected: PIM tables enforce the PIM multiplicities.

Fix:

  • NOT NULL on project.name, branch.name, tag.name, query.name, project.default_branch_id, and description on every Record table. Correct the comment at :498.
  • Drop commit_parent.ordinal (or document it as non-normative) and correct the comment at :272.
  • Add resource_identifier and an alias table for every Record subclass (Project, Commit, Branch, Tag, Query, DataIdentity, DataVersion).

Steps to Reproduce

  1. INSERT INTO sysml2.project (id) VALUES (gen_random_uuid()); is accepted with no name, no description and no default branch.

System Configuration

  • SysML2.NET version: PR [ADD] Sql schema #344 (feat/sql-schema-and-more, d5a90f2), SysML2.NET.CodeGenerator
  • Environment (Operating system, version and so on): Windows 11
  • .NET Framework version: .NET 10
  • Additional information: verified against https://www.omg.org/spec/SystemsModelingAPI/20250201/Systems-Modeling-API.xmi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CodeGenerationa Code Generation taskbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions