発行済みオブジェクトと下書きオブジェクト
Several objects in the OData V2 data model come in pairs, with a draft version (having a name starting with "Draft") and a published version (having a name starting with "Published").
Draft Tables
In draft tables (with the exception of the DraftProjects table), INSERT, UPDATE, and DELETE queries can be executed directly:
INSERT INTO DraftTasks (ProjectId, Finish, IsManual, Name, Notes, Start) VALUES ('68dceb1d-adac-ef11-bbda-00155df00e08', '2025-04-22', 'true', 'My new Test Task', 'Test temp Notes', '2025-04-18');
Published Tables
Unlike draft tables, published tables (with the exception of the PublishedProjects table) do not support INSERT, UPDATE, or DELETE queries directly, and are listed in the data model as ビュー.However, while published tables can't be updated directly, they can be updated indirectly using the corresponding draft table as an intermediary. To do this:
- Execute the CheckOut stored procedure to check out a project.
- Perform an INSERT, UPDATE, or DELETE query on the draft table corresponding to the published table you want to write to.
- Execute the Publish stored procedure to publish the checked-out project.
- Execute the CheckIn stored procedure to check in the changes.
For example:
EXEC CheckOut ProjectId = 'projectId'
INSERT INTO DraftTasks (Name, ProjectId) VALUES ('example', 'projectId')
EXEC Publish ProjectId = 'projectId'
EXEC CheckIn ProjectId = 'projectId'