Implement LmxOpcUa server — all 6 phases complete

Full OPC UA server on .NET Framework 4.8 (x86) exposing AVEVA System
Platform Galaxy tags via MXAccess. Mirrors Galaxy object hierarchy as
OPC UA address space, translating contained-name browse paths to
tag-name runtime references.

Components implemented:
- Configuration: AppConfiguration with 4 sections, validator
- Domain: ConnectionState, Quality, Vtq, MxDataTypeMapper, error codes
- MxAccess: StaComThread, MxAccessClient (partial classes), MxProxyAdapter
  using strongly-typed ArchestrA.MxAccess COM interop
- Galaxy Repository: SQL queries (hierarchy, attributes, change detection),
  ChangeDetectionService with auto-rebuild on deploy
- OPC UA Server: LmxNodeManager (CustomNodeManager2), LmxOpcUaServer,
  OpcUaServerHost with programmatic config, SecurityPolicy None
- Status Dashboard: HTTP server with HTML/JSON/health endpoints
- Integration: Full 14-step startup, graceful shutdown, component wiring

175 tests (174 unit + 1 integration), all passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-03-25 05:55:27 -04:00
commit a7576ffb38
283 changed files with 16493 additions and 0 deletions

51
gr/CLAUDE.md Normal file
View File

@@ -0,0 +1,51 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Purpose
The goal of this project is to identify and develop SQL queries that extract the Galaxy object hierarchy from the **System Platform Galaxy Repository** database in order to build a tag structure for an OPC UA server.
Specifically, we need to:
- Build the hierarchy of **areas** and **automation objects** (using contained names for human-readable browsing)
- Translate contained names to **tag_names** for read/write operations (e.g., `TestMachine_001.DelmiaReceiver` in the hierarchy becomes `DelmiaReceiver_001` when addressing tag values)
See `layout.md` for details on the hierarchy vs tag name relationship.
## Key Files
### Documentation
- `connectioninfo.md` — Database connection details and sqlcmd usage
- `layout.md` — Galaxy object hierarchy, contained_name vs tag_name translation, and target OPC UA structure
- `build_layout_plan.md` — Step-by-step plan for extracting hierarchy, attaching attributes, and monitoring for changes
- `data_type_mapping.md` — Galaxy mx_data_type to OPC UA DataType mapping, including array handling (ValueRank, ArrayDimensions)
### Queries
- `queries/hierarchy.sql` — Deployed object hierarchy with browse names and parent relationships
- `queries/attributes.sql` — User-defined (dynamic) attributes with data types and array dimensions
- `queries/attributes_extended.sql` — All attributes (system + user-defined) with data types and array dimensions
- `queries/change_detection.sql` — Poll `galaxy.time_of_last_deploy` to detect deployment changes
### Schema Reference
- `schema.md` — Full schema reference for all tables and views in the ZB database
- `ddl/tables/` — Individual CREATE TABLE definitions
- `ddl/views/` — Individual view definitions
## Working with the Galaxy Repository Database
The Galaxy Repository is the backing SQL Server database for Wonderware/AVEVA System Platform (Galaxy: ZB, localhost, Windows Auth). Key tables used by the queries:
- **gobject** — Object instances, hierarchy (contained_by_gobject_id, area_gobject_id), deployment state (deployed_package_id)
- **template_definition** — Object type categories (category_id distinguishes areas, engines, user-defined objects, etc.)
- **dynamic_attribute** — User-defined attributes on templates, inherited by instances via derived_from_gobject_id chain
- **attribute_definition** — System/primitive attributes
- **primitive_instance** — Links objects to their primitive components and attribute definitions
- **galaxy** — Single-row table with time_of_last_deploy for change detection
Use `sqlcmd -S localhost -d ZB -E -Q "..."` to run queries. See `connectioninfo.md` for details.
## Conventions
- Store all connection parameters in `connectioninfo.md`, not scattered across scripts.
- Keep SQL query examples and extraction notes as Markdown files in this repo.
- If scripts are added (Python, PowerShell, etc.), document their usage and dependencies alongside them.

84
gr/build_layout_plan.md Normal file
View File

@@ -0,0 +1,84 @@
# OPC UA Server Layout — Build Plan
## Overview
Extract the Galaxy object hierarchy and tag definitions from the ZB (Galaxy Repository) database to construct an OPC UA server address space. The root node is hardcoded as **ZB**.
## Step 1: Build the Browse Tree
Run `queries/hierarchy.sql` to get all deployed automation objects and their parent-child relationships.
For each row returned:
- `parent_gobject_id = 0` → child of the root ZB node
- `is_area = 1` → create as an OPC UA folder node (organizational)
- `is_area = 0` → create as an OPC UA object node (container for tags)
- Use `browse_name` as the OPC UA BrowseName/DisplayName
- Store `gobject_id` and `tag_name` for attribute lookup and tag reference translation
Build the tree by matching each row's `parent_gobject_id` to another row's `gobject_id`. The result is:
```
ZB (root, hardcoded)
└── DEV (folder, is_area=1)
├── DevAppEngine (object)
├── DevPlatform (object)
└── TestArea (folder, is_area=1)
├── DevTestObject (object)
└── TestMachine_001 (object)
├── DelmiaReceiver (object, browse_name from contained_name)
└── MESReceiver (object, browse_name from contained_name)
```
## Step 2: Attach Attributes as Tag Nodes
Run `queries/attributes.sql` to get all user-defined attributes for deployed objects.
For each attribute row:
- Match to the browse tree via `gobject_id`
- Create an OPC UA variable node under the matching object node
- Use `attribute_name` as the BrowseName/DisplayName
- Use `full_tag_reference` as the runtime tag path for read/write operations
- Map `mx_data_type` to OPC UA built-in types:
| mx_data_type | Description | OPC UA Type |
|--------------|-------------|-------------|
| 1 | Boolean | Boolean |
| 2 | Integer | Int32 |
| 3 | Float | Float |
| 4 | Double | Double |
| 5 | String | String |
| 6 | Time | DateTime |
| 7 | ElapsedTime | Double (seconds) or Duration |
- If `is_array = 1`, create the variable as an array with rank 1 and dimension from `array_dimension`
## Step 3: Monitor for Changes
Poll `queries/change_detection.sql` on a regular interval (e.g., every 30 seconds).
```
SELECT time_of_last_deploy FROM galaxy;
```
Compare the returned `time_of_last_deploy` to the last known value:
- **No change** → do nothing
- **Changed** → a deployment occurred; re-run Steps 1 and 2 to rebuild the address space
This handles objects being deployed, undeployed, added, or removed.
## Connection Details
See `connectioninfo.md` for database connection parameters and sqlcmd usage.
```
sqlcmd -S localhost -d ZB -E -Q "YOUR QUERY HERE"
```
## Query Files
| File | Purpose |
|------|---------|
| `queries/hierarchy.sql` | Deployed object hierarchy with browse names and parent relationships |
| `queries/attributes.sql` | User-defined attributes with data types and array dimensions |
| `queries/attributes_extended.sql` | All attributes (system + user-defined) with data types and array dimensions |
| `queries/change_detection.sql` | Poll galaxy.time_of_last_deploy for deployment changes |

26
gr/connectioninfo.md Normal file
View File

@@ -0,0 +1,26 @@
# Galaxy Repository — Connection Information
## Database Connection
| Parameter | Value |
|-----------------|----------------|
| Server | localhost (default instance) |
| Database Name | ZB |
| Port | 1433 (default) |
| Authentication | Windows Auth |
| Username | dohertj2 |
## sqlcmd Usage
```
sqlcmd -S localhost -d ZB -E -Q "YOUR QUERY HERE"
```
- `-S localhost` — default instance
- `-d ZB` — database name
- `-E` — Windows Authentication (dohertj2)
## Notes
- The Galaxy Repository is a SQL Server database created and managed by AVEVA System Platform (formerly Wonderware).
- Typically accessed via SQL Server Management Studio (SSMS), `sqlcmd`, or programmatically via ODBC/ADO.NET/pyodbc.

80
gr/data_type_mapping.md Normal file
View File

@@ -0,0 +1,80 @@
# Data Type Mapping — Galaxy Repository to OPC UA
## Scalar Type Mapping
| mx_data_type | Galaxy Description | OPC UA DataType | OPC UA NodeId | Notes |
|--------------|--------------------|-----------------|---------------|-------|
| 1 | Boolean | Boolean | i=1 | Direct mapping |
| 2 | Integer (Int32) | Int32 | i=6 | Galaxy integers are 32-bit signed |
| 3 | Float (Single) | Float | i=10 | 32-bit IEEE 754 |
| 4 | Double | Double | i=11 | 64-bit IEEE 754 |
| 5 | String | String | i=12 | Unicode string |
| 6 | Time (DateTime) | DateTime | i=13 | Galaxy DateTime to OPC UA DateTime (100ns ticks since 1601-01-01) |
| 7 | ElapsedTime (TimeSpan) | Double | i=11 | No native OPC UA TimeSpan; map to Double representing seconds (or use Duration type alias, NodeId i=290) |
| 8 | (reference) | String | i=12 | Object reference; expose as string representation |
| 13 | (enumeration) | Int32 | i=6 | Enum backing value is integer |
| 14 | (custom) | String | i=12 | Fallback to string |
| 15 | InternationalizedString | LocalizedText | i=21 | OPC UA LocalizedText supports locale + text pairs |
| 16 | (custom) | String | i=12 | Fallback to string |
## OPC UA Built-in Type Reference
For context, the full set of OPC UA built-in types and their NodeIds:
| NodeId | Type | Description |
|--------|------|-------------|
| i=1 | Boolean | True/false |
| i=2 | SByte | Signed 8-bit integer |
| i=3 | Byte | Unsigned 8-bit integer |
| i=4 | Int16 | Signed 16-bit integer |
| i=5 | UInt16 | Unsigned 16-bit integer |
| i=6 | Int32 | Signed 32-bit integer |
| i=7 | UInt32 | Unsigned 32-bit integer |
| i=8 | Int64 | Signed 64-bit integer |
| i=9 | UInt64 | Unsigned 64-bit integer |
| i=10 | Float | 32-bit IEEE 754 |
| i=11 | Double | 64-bit IEEE 754 |
| i=12 | String | Unicode string |
| i=13 | DateTime | Date and time (100ns ticks since 1601-01-01) |
| i=14 | Guid | 128-bit globally unique identifier |
| i=15 | ByteString | Sequence of bytes |
| i=21 | LocalizedText | Locale + text pair |
## Array Handling
When `is_array = 1` in the attributes query, the OPC UA variable node must be configured as an array.
### ValueRank
Set on the OPC UA variable node to indicate scalar vs array:
| is_array | ValueRank | Meaning |
|----------|-----------|---------|
| 0 | -1 (Scalar) | Value is not an array |
| 1 | 1 (OneDimension) | Value is a one-dimensional array |
### ArrayDimensions
When `ValueRank = 1`, set the `ArrayDimensions` attribute to a single-element array containing the `array_dimension` value from the attributes query.
Example for `MESReceiver_001.MoveInPartNumbers` (`is_array=1`, `array_dimension=50`):
- DataType: String (i=12)
- ValueRank: 1
- ArrayDimensions: [50]
Example for `TestMachine_001.MachineID` (`is_array=0`):
- DataType: String (i=12)
- ValueRank: -1
- ArrayDimensions: (not set)
## DateTime Conversion
Galaxy `Time` (mx_data_type=6) stores DateTime values. OPC UA DateTime is defined as the number of 100-nanosecond intervals since January 1, 1601 (UTC). Ensure the conversion accounts for:
- Timezone: Galaxy may store local time; OPC UA expects UTC
- Epoch difference: adjust if Galaxy uses a different epoch (e.g., Unix epoch 1970-01-01)
## ElapsedTime Handling
Galaxy `ElapsedTime` (mx_data_type=7) represents a duration/timespan. OPC UA has no native TimeSpan type. Options:
- **Double (i=11)**: Store as seconds (recommended for simplicity)
- **Duration (i=290)**: OPC UA type alias for Double, semantically represents milliseconds — use if the OPC UA SDK supports it

View File

@@ -0,0 +1,13 @@
-- Table: ConversionQueue
CREATE TABLE [ConversionQueue] (
[id] int NULL,
[Name] nvarchar(329) NULL,
[IsCheckedOut] bit NOT NULL,
[Status] bit NOT NULL DEFAULT ((0)),
[MetaData] nchar(256) NULL,
[OperationType] nchar(20) NOT NULL,
[timestamp_of_last_change] bigint NULL,
[change_type] int NULL
);
GO

View File

@@ -0,0 +1,9 @@
-- Table: CurrentSessionContainedName
CREATE TABLE [CurrentSessionContainedName] (
[Uniqeid] int NOT NULL,
[obj_id] int NULL,
[containedname] nvarchar(32) NULL,
CONSTRAINT [PK_CurrentSessionContainedName] PRIMARY KEY ([Uniqeid])
);
GO

View File

@@ -0,0 +1,7 @@
-- Table: ImportTransaction
CREATE TABLE [ImportTransaction] (
[ImportOperationId] nvarchar(329) NULL,
[Status] bit NOT NULL DEFAULT ((1))
);
GO

View File

@@ -0,0 +1,8 @@
-- Table: aa_sql_objects
CREATE TABLE [aa_sql_objects] (
[object_name] nvarchar(128) NOT NULL,
[object_type] nvarchar(10) NOT NULL,
CONSTRAINT [PK_aa_sql_objects] PRIMARY KEY ([object_name])
);
GO

View File

@@ -0,0 +1,9 @@
-- Table: affected_overview_symbols
CREATE TABLE [affected_overview_symbols] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[mx_primitive_id] smallint NOT NULL,
[visual_element_id] int NOT NULL
);
GO

View File

@@ -0,0 +1,8 @@
-- Table: alarm_message_defaults
CREATE TABLE [alarm_message_defaults] (
[phrase_id] int NOT NULL,
[default_message] nvarchar(1024) NOT NULL,
CONSTRAINT [PK_alarm_message_defaults] PRIMARY KEY ([phrase_id])
);
GO

View File

@@ -0,0 +1,8 @@
-- Table: alarm_message_timestamps
CREATE TABLE [alarm_message_timestamps] (
[gobject_id] int NOT NULL,
[timestamp_of_populate] bigint NOT NULL DEFAULT ((0)),
CONSTRAINT [PK_alarm_message_timestamps] PRIMARY KEY ([gobject_id])
);
GO

View File

@@ -0,0 +1,12 @@
-- Table: alarm_message_translations
CREATE TABLE [alarm_message_translations] (
[phrase_id] int NOT NULL,
[locale_id] smallint NOT NULL,
[translated_message] nvarchar(1024) NOT NULL,
CONSTRAINT [PK_alarm_message_translations] PRIMARY KEY ([phrase_id], [locale_id], [phrase_id], [locale_id])
);
GO
ALTER TABLE [alarm_message_translations] ADD FOREIGN KEY ([locale_id]) REFERENCES [supported_locales] ([locale_id]);
GO

View File

@@ -0,0 +1,13 @@
-- Table: alarm_messages
CREATE TABLE [alarm_messages] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[mx_primitive_id] smallint NOT NULL,
[phrase_id] int NOT NULL,
CONSTRAINT [PK_alarm_messages] PRIMARY KEY ([gobject_id], [package_id], [mx_primitive_id], [phrase_id], [gobject_id], [gobject_id], [mx_primitive_id], [package_id], [gobject_id], [mx_primitive_id], [package_id], [gobject_id], [mx_primitive_id], [package_id])
);
GO
ALTER TABLE [alarm_messages] ADD FOREIGN KEY ([package_id]) REFERENCES [primitive_instance] ([package_id]);
GO

View File

@@ -0,0 +1,24 @@
-- Table: attribute_definition
CREATE TABLE [attribute_definition] (
[attribute_definition_id] int NOT NULL,
[primitive_definition_id] int NOT NULL,
[attribute_name] nvarchar(329) NOT NULL,
[mx_attribute_id] smallint NOT NULL,
[has_config_set_handler] bit NOT NULL,
[mx_data_type] smallint NOT NULL,
[is_array] bit NOT NULL,
[security_classification] smallint NOT NULL,
[security_classification_needs_deployed] bit NOT NULL,
[mx_attribute_category] int NOT NULL,
[is_frequently_accessed] bit NOT NULL,
[is_locked] bit NOT NULL,
[is_locked_needs_deployed] bit NOT NULL,
[mx_value] text(2147483647) NOT NULL,
[mx_value_needs_deployed] bit NOT NULL,
CONSTRAINT [PK_attribute_definition] PRIMARY KEY ([primitive_definition_id], [mx_attribute_id], [primitive_definition_id])
);
GO
ALTER TABLE [attribute_definition] ADD FOREIGN KEY ([primitive_definition_id]) REFERENCES [primitive_definition] ([primitive_definition_id]);
GO

View File

@@ -0,0 +1,26 @@
-- Table: attribute_reference
CREATE TABLE [attribute_reference] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[referring_mx_primitive_id] smallint NOT NULL DEFAULT ((0)),
[referring_mx_attribute_id] smallint NOT NULL DEFAULT ((0)),
[element_index] smallint NOT NULL DEFAULT ((0)),
[resolved_gobject_id] int NOT NULL DEFAULT ((0)),
[reference_string] nvarchar(700) NOT NULL DEFAULT (''),
[context_string] nvarchar(329) NOT NULL DEFAULT (''),
[object_signature] int NOT NULL DEFAULT ((0)),
[resolved_mx_primitive_id] smallint NOT NULL DEFAULT ((0)),
[resolved_mx_attribute_id] smallint NOT NULL DEFAULT ((0)),
[resolved_mx_property_id] smallint NOT NULL DEFAULT ((0)),
[attribute_signature] int NOT NULL DEFAULT ((0)),
[lock_type] int NOT NULL DEFAULT ((0)),
[is_valid] bit NOT NULL DEFAULT ((0)),
[attr_res_status] int NOT NULL DEFAULT ((0)),
[attribute_index] smallint NULL DEFAULT ((-1)),
CONSTRAINT [PK_attribute_reference] PRIMARY KEY ([gobject_id], [package_id], [referring_mx_primitive_id], [referring_mx_attribute_id], [element_index], [gobject_id], [package_id], [referring_mx_primitive_id], [gobject_id], [package_id], [referring_mx_primitive_id], [gobject_id], [package_id], [referring_mx_primitive_id])
);
GO
ALTER TABLE [attribute_reference] ADD FOREIGN KEY ([referring_mx_primitive_id]) REFERENCES [primitive_instance] ([package_id]);
GO

View File

@@ -0,0 +1,11 @@
-- Table: attributes_translation_table
CREATE TABLE [attributes_translation_table] (
[gobject_id] int NULL,
[attribute_name] nvarchar(329) NOT NULL,
[new_primitive_id] int NULL,
[new_attribute_id] int NULL,
[old_primitive_id] int NULL,
[old_attribute_id] int NULL
);
GO

View File

@@ -0,0 +1,11 @@
-- Table: autobind_device
CREATE TABLE [autobind_device] (
[dio_id] int NOT NULL,
[overridden_naming_rule_id] int NULL,
CONSTRAINT [PK_autobind_device] PRIMARY KEY ([dio_id], [overridden_naming_rule_id], [dio_id])
);
GO
ALTER TABLE [autobind_device] ADD FOREIGN KEY ([dio_id]) REFERENCES [gobject] ([gobject_id]);
GO

View File

@@ -0,0 +1,11 @@
-- Table: autobind_device_category
CREATE TABLE [autobind_device_category] (
[category_id] smallint NOT NULL,
[rule_id] int NULL DEFAULT ((0)),
CONSTRAINT [PK_autobind_device_category] PRIMARY KEY ([category_id], [rule_id], [category_id])
);
GO
ALTER TABLE [autobind_device_category] ADD FOREIGN KEY ([category_id]) REFERENCES [lookup_category] ([category_id]);
GO

View File

@@ -0,0 +1,11 @@
-- Table: autobind_device_template
CREATE TABLE [autobind_device_template] (
[template_definition_id] int NOT NULL,
[rule_id] int NULL,
CONSTRAINT [PK_autobind_device_template] PRIMARY KEY ([template_definition_id], [rule_id], [template_definition_id])
);
GO
ALTER TABLE [autobind_device_template] ADD FOREIGN KEY ([template_definition_id]) REFERENCES [template_definition] ([template_definition_id]);
GO

View File

@@ -0,0 +1,13 @@
-- Table: autobind_device_topic
CREATE TABLE [autobind_device_topic] (
[dio_id] int NOT NULL,
[sg_mx_primitive_id] smallint NOT NULL DEFAULT ((0)),
[overridden_naming_rule_id] int NULL,
[default_xlate_rule_id] int NOT NULL DEFAULT ((0)),
CONSTRAINT [PK_autobind_device_topic] PRIMARY KEY ([dio_id], [sg_mx_primitive_id], [overridden_naming_rule_id], [dio_id])
);
GO
ALTER TABLE [autobind_device_topic] ADD FOREIGN KEY ([dio_id]) REFERENCES [autobind_device] ([dio_id]);
GO

View File

@@ -0,0 +1,8 @@
-- Table: autobind_naming_rule
CREATE TABLE [autobind_naming_rule] (
[rule_id] int NOT NULL,
[rule_name] nvarchar(329) NOT NULL,
CONSTRAINT [PK_autobind_naming_rule] PRIMARY KEY ([rule_id])
);
GO

View File

@@ -0,0 +1,12 @@
-- Table: autobind_naming_rule_spec
CREATE TABLE [autobind_naming_rule_spec] (
[rule_id] int NOT NULL,
[io_type] nchar(1) NOT NULL,
[rule_spec] nvarchar(512) NOT NULL,
CONSTRAINT [PK_autobind_naming_rule_spec] PRIMARY KEY ([rule_id], [io_type], [rule_id])
);
GO
ALTER TABLE [autobind_naming_rule_spec] ADD FOREIGN KEY ([rule_id]) REFERENCES [autobind_naming_rule] ([rule_id]);
GO

View File

@@ -0,0 +1,10 @@
-- Table: autobind_translation_rule
CREATE TABLE [autobind_translation_rule] (
[xlate_rule_id] int NOT NULL,
[xlate_rule_name] nvarchar(329) NOT NULL,
[xlate_rule_gsub_str] nvarchar(1000) NULL,
[xlate_rule_scope_global] bit NOT NULL DEFAULT ((0)),
CONSTRAINT [PK_autobind_translation_rule] PRIMARY KEY ([xlate_rule_id])
);
GO

View File

@@ -0,0 +1,17 @@
-- Table: autobound_attribute
CREATE TABLE [autobound_attribute] (
[dio_id] int NOT NULL,
[sg_mx_primitive_id] smallint NOT NULL DEFAULT ((0)),
[gobject_id] int NOT NULL,
[mx_primitive_id] smallint NOT NULL,
[mx_attribute_id] smallint NOT NULL,
[element_index] smallint NOT NULL DEFAULT ((0)),
[attr_alias] nvarchar(329) NULL,
[xlate_rule_id] int NOT NULL DEFAULT ((0)),
CONSTRAINT [PK_autobound_attribute] PRIMARY KEY ([gobject_id], [mx_primitive_id], [mx_attribute_id], [element_index], [dio_id], [sg_mx_primitive_id], [dio_id], [sg_mx_primitive_id], [xlate_rule_id])
);
GO
ALTER TABLE [autobound_attribute] ADD FOREIGN KEY ([xlate_rule_id]) REFERENCES [autobind_translation_rule] ([xlate_rule_id]);
GO

View File

@@ -0,0 +1,9 @@
-- Table: client_control_class_link
CREATE TABLE [client_control_class_link] (
[gobject_id] int NOT NULL,
[file_id] int NULL,
[class_name] nvarchar(1024) NOT NULL,
CONSTRAINT [PK_client_control_class_link] PRIMARY KEY ([gobject_id])
);
GO

View File

@@ -0,0 +1,11 @@
-- Table: client_info
CREATE TABLE [client_info] (
[id] int NOT NULL,
[client_unique_identifier] nvarchar(4000) NOT NULL,
[client_name] nvarchar(64) NOT NULL,
[deployed_files_count] smallint NOT NULL,
[time_of_last_deployed_object_components] datetime NULL DEFAULT (getdate()),
[timestamp_of_last_synchronized] bigint NOT NULL DEFAULT ((0))
);
GO

View File

@@ -0,0 +1,16 @@
-- Table: control_index
CREATE TABLE [control_index] (
[entity_id] int NOT NULL,
[gobject_id] int NOT NULL,
[control_id] nvarchar(329) NULL,
[control_name] nvarchar(329) NOT NULL,
[control_description] nvarchar(2000) NULL,
[properties] nvarchar(-1) NULL,
[thumbnail] nvarchar(-1) NULL,
CONSTRAINT [PK_control_index] PRIMARY KEY ([gobject_id], [control_name], [gobject_id])
);
GO
ALTER TABLE [control_index] ADD FOREIGN KEY ([gobject_id]) REFERENCES [gobject] ([gobject_id]);
GO

View File

@@ -0,0 +1,9 @@
-- Table: data_type
CREATE TABLE [data_type] (
[mx_data_type] tinyint NOT NULL,
[description] varchar(30) NOT NULL,
[ow_data_type] varchar(10) NULL,
CONSTRAINT [PK_data_type] PRIMARY KEY ([mx_data_type])
);
GO

View File

@@ -0,0 +1,8 @@
-- Table: deleted_gobject
CREATE TABLE [deleted_gobject] (
[gobject_id] int NOT NULL DEFAULT ((0)),
[timestamp_of_delete] timestamp NOT NULL,
CONSTRAINT [PK_deleted_gobject] PRIMARY KEY ([timestamp_of_delete])
);
GO

View File

@@ -0,0 +1,9 @@
-- Table: deleted_ids
CREATE TABLE [deleted_ids] (
[table_id] smallint NULL,
[deleted_id] int NOT NULL,
[deletion_timestamp] timestamp NOT NULL,
[deletion_time] datetime NULL
);
GO

View File

@@ -0,0 +1,8 @@
-- Table: deleted_visual_element
CREATE TABLE [deleted_visual_element] (
[visual_element_name] nvarchar(329) NULL,
[visual_element_type] nvarchar(32) NULL,
[timestamp_of_delete] timestamp NOT NULL
);
GO

View File

@@ -0,0 +1,13 @@
-- Table: deleted_visual_element_version
CREATE TABLE [deleted_visual_element_version] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[mx_primitive_id] smallint NOT NULL,
[visual_element_name] nvarchar(329) NOT NULL,
[visual_element_type] nvarchar(32) NOT NULL,
[timestamp_of_delete] timestamp NOT NULL,
[visual_element_id] int NOT NULL,
CONSTRAINT [PK_deleted_visual_element_version] PRIMARY KEY ([gobject_id], [package_id], [timestamp_of_delete])
);
GO

View File

@@ -0,0 +1,19 @@
-- Table: deployed_file
CREATE TABLE [deployed_file] (
[deployed_file_id] int NOT NULL,
[file_id] int NOT NULL,
[node_name] nvarchar(256) NOT NULL,
[need_to_delete] int NOT NULL DEFAULT ((0)),
[is_package_deployed] bit NOT NULL,
[is_editor_deployed] bit NOT NULL,
[is_runtime_deployed] bit NOT NULL,
[is_browser_deployed] bit NOT NULL,
[file_version] nvarchar(50) NOT NULL DEFAULT (''),
[file_modified_time] nvarchar(50) NOT NULL DEFAULT (''),
CONSTRAINT [PK_deployed_file] PRIMARY KEY ([deployed_file_id], [file_id])
);
GO
ALTER TABLE [deployed_file] ADD FOREIGN KEY ([file_id]) REFERENCES [file_table] ([file_id]);
GO

View File

@@ -0,0 +1,8 @@
-- Table: deployed_intouch_viewapp
CREATE TABLE [deployed_intouch_viewapp] (
[timestamp_of_deploy] bigint NOT NULL DEFAULT ((1)),
[gobject_id] int NOT NULL,
[deploy_file_transfering] bit NULL DEFAULT ((0))
);
GO

View File

@@ -0,0 +1,7 @@
-- Table: deployed_intouch_viewapp_visual_element_dependency
CREATE TABLE [deployed_intouch_viewapp_visual_element_dependency] (
[gobject_id] int NULL,
[visual_element_name] nvarchar(2000) NULL
);
GO

View File

@@ -0,0 +1,25 @@
-- Table: dynamic_attribute
CREATE TABLE [dynamic_attribute] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[mx_primitive_id] smallint NOT NULL,
[mx_attribute_id] smallint NOT NULL,
[attribute_name] nvarchar(329) NOT NULL,
[mx_data_type] smallint NOT NULL,
[is_array] bit NOT NULL,
[security_classification] smallint NOT NULL,
[mx_attribute_category] int NOT NULL,
[lock_type] int NOT NULL,
[mx_value] text(2147483647) NOT NULL,
[owned_by_gobject_id] int NOT NULL DEFAULT ((0)),
[original_lock_type] int NOT NULL DEFAULT ((0)),
[dynamic_attribute_type] smallint NOT NULL DEFAULT ((0)),
[bitvalues] smallint NOT NULL DEFAULT ((0)),
[dynamic_attribute_id] bigint NOT NULL,
CONSTRAINT [PK_dynamic_attribute] PRIMARY KEY ([gobject_id], [package_id], [mx_primitive_id], [mx_attribute_id], [gobject_id], [mx_primitive_id], [package_id], [gobject_id], [mx_primitive_id], [package_id], [gobject_id], [mx_primitive_id], [package_id])
);
GO
ALTER TABLE [dynamic_attribute] ADD FOREIGN KEY ([package_id]) REFERENCES [primitive_instance] ([package_id]);
GO

View File

@@ -0,0 +1,12 @@
-- Table: external_content_media_types
CREATE TABLE [external_content_media_types] (
[entity_id] int NOT NULL,
[media_type] nvarchar(255) NOT NULL,
[control_entity_id] int NOT NULL,
[uri_property_name] nvarchar(1023) NULL,
[media_type_property_name] nvarchar(1023) NULL,
[is_default] bit NULL,
CONSTRAINT [PK_external_content_media_types] PRIMARY KEY ([entity_id])
);
GO

View File

@@ -0,0 +1,9 @@
-- Table: feature
CREATE TABLE [feature] (
[feature_id] int NOT NULL,
[feature_name] nvarchar(256) NOT NULL,
[feature_type] nvarchar(256) NOT NULL,
CONSTRAINT [PK_feature] PRIMARY KEY ([feature_id])
);
GO

View File

@@ -0,0 +1,11 @@
-- Table: feature_file_link
CREATE TABLE [feature_file_link] (
[feature_id] int NOT NULL,
[file_id] int NOT NULL,
CONSTRAINT [PK_feature_file_link] PRIMARY KEY ([feature_id], [file_id], [feature_id], [file_id])
);
GO
ALTER TABLE [feature_file_link] ADD FOREIGN KEY ([file_id]) REFERENCES [file_table] ([file_id]);
GO

View File

@@ -0,0 +1,13 @@
-- Table: file_browserinfo_link
CREATE TABLE [file_browserinfo_link] (
[primitive_definition_id] int NOT NULL,
[file_id] int NOT NULL,
[assembly_strong_name] nvarchar(512) NOT NULL,
[assembly_type_name] nvarchar(256) NOT NULL,
CONSTRAINT [PK_file_browserinfo_link] PRIMARY KEY ([primitive_definition_id], [file_id], [file_id], [primitive_definition_id])
);
GO
ALTER TABLE [file_browserinfo_link] ADD FOREIGN KEY ([primitive_definition_id]) REFERENCES [primitive_definition] ([primitive_definition_id]);
GO

View File

@@ -0,0 +1,11 @@
-- Table: file_pending_update
CREATE TABLE [file_pending_update] (
[file_id] int NOT NULL,
[node_name] nvarchar(256) NOT NULL,
CONSTRAINT [PK_file_pending_update] PRIMARY KEY ([file_id])
);
GO
ALTER TABLE [file_pending_update] ADD FOREIGN KEY ([file_id]) REFERENCES [file_table] ([file_id]);
GO

View File

@@ -0,0 +1,15 @@
-- Table: file_primitive_definition_link
CREATE TABLE [file_primitive_definition_link] (
[primitive_definition_id] int NOT NULL,
[file_id] int NOT NULL,
[is_needed_for_package] bit NOT NULL DEFAULT ((0)),
[is_needed_for_runtime] bit NOT NULL DEFAULT ((0)),
[is_needed_for_editor] bit NOT NULL DEFAULT ((0)),
[is_needed_for_browser] bit NOT NULL DEFAULT ((0)),
CONSTRAINT [PK_file_primitive_definition_link] PRIMARY KEY ([primitive_definition_id], [file_id], [file_id], [primitive_definition_id])
);
GO
ALTER TABLE [file_primitive_definition_link] ADD FOREIGN KEY ([primitive_definition_id]) REFERENCES [primitive_definition] ([primitive_definition_id]);
GO

View File

@@ -0,0 +1,13 @@
-- Table: file_table
CREATE TABLE [file_table] (
[file_id] int NOT NULL,
[file_name] nvarchar(256) NOT NULL,
[vendor_name] nvarchar(256) NOT NULL,
[registration_type] int NOT NULL,
[subfolder] nvarchar(256) NOT NULL DEFAULT (''),
[file_version] nvarchar(50) NOT NULL DEFAULT (''),
[file_modified_time] nvarchar(50) NOT NULL DEFAULT (''),
CONSTRAINT [PK_file_table] PRIMARY KEY ([file_id])
);
GO

14
gr/ddl/tables/folder.sql Normal file
View File

@@ -0,0 +1,14 @@
-- Table: folder
CREATE TABLE [folder] (
[folder_id] int NOT NULL,
[folder_type] smallint NOT NULL,
[folder_name] nvarchar(64) NOT NULL,
[parent_folder_id] int NOT NULL,
[depth] int NOT NULL,
[has_objects] bit NOT NULL,
[has_folders] bit NOT NULL,
[timestamp_of_last_change] timestamp NOT NULL,
CONSTRAINT [PK_folder] PRIMARY KEY ([folder_id])
);
GO

View File

@@ -0,0 +1,13 @@
-- Table: folder_gobject_link
CREATE TABLE [folder_gobject_link] (
[folder_id] int NOT NULL,
[folder_type] smallint NOT NULL,
[gobject_id] int NOT NULL,
[timestamp_of_last_change] timestamp NOT NULL,
CONSTRAINT [PK_folder_gobject_link] PRIMARY KEY ([folder_id], [gobject_id], [gobject_id])
);
GO
ALTER TABLE [folder_gobject_link] ADD FOREIGN KEY ([gobject_id]) REFERENCES [gobject] ([gobject_id]);
GO

18
gr/ddl/tables/galaxy.sql Normal file
View File

@@ -0,0 +1,18 @@
-- Table: galaxy
CREATE TABLE [galaxy] (
[time_of_last_deploy] datetime NULL DEFAULT (getdate()),
[time_of_last_config_change] datetime NULL DEFAULT (getdate()),
[is_galaxy_installed] bit NOT NULL DEFAULT ((1)),
[time_of_last_reference_binding] datetime NULL DEFAULT (getdate()),
[timestamp_of_last_cascade] bigint NOT NULL DEFAULT ((1)),
[timestamp_of_last_visual_element_reference_bind] bigint NOT NULL DEFAULT ((0)),
[max_proxy_timestamp] bigint NOT NULL DEFAULT (CONVERT([bigint],@@dbts)),
[max_visual_element_timestamp] bigint NOT NULL DEFAULT (CONVERT([bigint],@@dbts)),
[is_migration_in_progress] bit NOT NULL DEFAULT ((0)),
[time_of_last_association_change] datetime NULL DEFAULT (getdate()),
[subscription_id] uniqueidentifier NULL,
[batch_id] uniqueidentifier NULL,
[iteration_id] int NOT NULL DEFAULT ((0))
);
GO

View File

@@ -0,0 +1,7 @@
-- Table: galaxy_data
CREATE TABLE [galaxy_data] (
[data_type] nvarchar(256) NOT NULL,
[data] image(2147483647) NULL
);
GO

View File

@@ -0,0 +1,8 @@
-- Table: galaxy_settings
CREATE TABLE [galaxy_settings] (
[galaxyid] int NULL,
[default_qs_data] ntext(1073741823) NOT NULL,
[current_qs_data] ntext(1073741823) NOT NULL
);
GO

35
gr/ddl/tables/gobject.sql Normal file
View File

@@ -0,0 +1,35 @@
-- Table: gobject
CREATE TABLE [gobject] (
[gobject_id] int NOT NULL,
[template_definition_id] int NOT NULL,
[derived_from_gobject_id] int NOT NULL DEFAULT ((0)),
[contained_by_gobject_id] int NOT NULL DEFAULT ((0)),
[area_gobject_id] int NOT NULL DEFAULT ((0)),
[hosted_by_gobject_id] int NOT NULL DEFAULT ((0)),
[checked_out_by_user_guid] uniqueidentifier NULL,
[default_symbol_gobject_id] int NOT NULL DEFAULT ((0)),
[default_display_gobject_id] int NOT NULL DEFAULT ((0)),
[checked_in_package_id] int NOT NULL DEFAULT ((0)),
[checked_out_package_id] int NOT NULL DEFAULT ((0)),
[deployed_package_id] int NOT NULL DEFAULT ((0)),
[last_deployed_package_id] int NOT NULL DEFAULT ((0)),
[tag_name] nvarchar(329) NOT NULL,
[contained_name] nvarchar(32) NOT NULL DEFAULT (''),
[identity_guid] uniqueidentifier NOT NULL DEFAULT (newid()),
[configuration_guid] uniqueidentifier NOT NULL,
[configuration_version] int NOT NULL,
[deployed_version] int NOT NULL DEFAULT ((0)),
[is_template] bit NOT NULL DEFAULT ((0)),
[is_hidden] bit NOT NULL DEFAULT ((0)),
[software_upgrade_needed] bit NOT NULL DEFAULT ((0)),
[hosting_tree_level] smallint NOT NULL DEFAULT ((0)),
[hierarchical_name] nvarchar(329) NOT NULL DEFAULT (''),
[namespace_id] smallint NOT NULL DEFAULT ((1)),
[deployment_pending_status] bit NOT NULL DEFAULT ((0)),
CONSTRAINT [PK_gobject] PRIMARY KEY ([gobject_id], [namespace_id], [template_definition_id])
);
GO
ALTER TABLE [gobject] ADD FOREIGN KEY ([template_definition_id]) REFERENCES [template_definition] ([template_definition_id]);
GO

View File

@@ -0,0 +1,11 @@
-- Table: gobject_asset_order
CREATE TABLE [gobject_asset_order] (
[gobject_id] int NOT NULL,
[relative_index] float(53,) NOT NULL,
CONSTRAINT [PK_gobject_asset_order] PRIMARY KEY ([gobject_id])
);
GO
ALTER TABLE [gobject_asset_order] ADD FOREIGN KEY ([gobject_id]) REFERENCES [gobject] ([gobject_id]);
GO

View File

@@ -0,0 +1,16 @@
-- Table: gobject_change_log
CREATE TABLE [gobject_change_log] (
[gobject_change_log_id] int NOT NULL,
[gobject_id] int NOT NULL,
[change_date] datetime NULL,
[operation_id] smallint NOT NULL,
[user_comment] nvarchar(1024) NOT NULL DEFAULT (''),
[configuration_version] int NOT NULL DEFAULT ((0)),
[user_profile_name] nvarchar(256) NOT NULL,
CONSTRAINT [PK_gobject_change_log] PRIMARY KEY ([gobject_id], [operation_id])
);
GO
ALTER TABLE [gobject_change_log] ADD FOREIGN KEY ([operation_id]) REFERENCES [lookup_operation] ([operation_id]);
GO

View File

@@ -0,0 +1,11 @@
-- Table: gobject_filter_info_timestamp
CREATE TABLE [gobject_filter_info_timestamp] (
[gobject_id] int NULL,
[timestamp_of_last_change] timestamp NOT NULL,
CONSTRAINT [PK_gobject_filter_info_timestamp] PRIMARY KEY ([timestamp_of_last_change], [gobject_id])
);
GO
ALTER TABLE [gobject_filter_info_timestamp] ADD FOREIGN KEY ([gobject_id]) REFERENCES [gobject] ([gobject_id]);
GO

View File

@@ -0,0 +1,11 @@
-- Table: gobject_friendly_name
CREATE TABLE [gobject_friendly_name] (
[gobject_id] int NOT NULL,
[friendly_name] nvarchar(1024) NOT NULL DEFAULT (''),
CONSTRAINT [PK_gobject_friendly_name] PRIMARY KEY ([gobject_id])
);
GO
ALTER TABLE [gobject_friendly_name] ADD FOREIGN KEY ([gobject_id]) REFERENCES [gobject] ([gobject_id]);
GO

View File

@@ -0,0 +1,7 @@
-- Table: gobject_log_details
CREATE TABLE [gobject_log_details] (
[gobject_id] int NOT NULL,
[tag_name] nvarchar(329) NOT NULL
);
GO

View File

@@ -0,0 +1,6 @@
-- Table: gobject_protected
CREATE TABLE [gobject_protected] (
[gobject_id] int NOT NULL
);
GO

View File

@@ -0,0 +1,13 @@
-- Table: instance
CREATE TABLE [instance] (
[gobject_id] int NOT NULL,
[mx_platform_id] smallint NOT NULL DEFAULT ((0)),
[mx_engine_id] smallint NOT NULL DEFAULT ((0)),
[mx_object_id] smallint NOT NULL DEFAULT ((0)),
CONSTRAINT [PK_instance] PRIMARY KEY ([gobject_id], [gobject_id])
);
GO
ALTER TABLE [instance] ADD FOREIGN KEY ([gobject_id]) REFERENCES [gobject] ([gobject_id]);
GO

View File

@@ -0,0 +1,6 @@
-- Table: intouchviewapptemplate_allsymbols
CREATE TABLE [intouchviewapptemplate_allsymbols] (
[gobject_id] int NOT NULL
);
GO

View File

@@ -0,0 +1,8 @@
-- Table: lookup_category
CREATE TABLE [lookup_category] (
[category_id] smallint NOT NULL,
[category_name] nvarchar(50) NOT NULL,
CONSTRAINT [PK_lookup_category] PRIMARY KEY ([category_id])
);
GO

View File

@@ -0,0 +1,7 @@
-- Table: lookup_folder
CREATE TABLE [lookup_folder] (
[folder_type] smallint NOT NULL,
[folder_type_name] nvarchar(32) NULL
);
GO

View File

@@ -0,0 +1,9 @@
-- Table: lookup_operation
CREATE TABLE [lookup_operation] (
[operation_id] smallint NOT NULL,
[operation_code] nvarchar(50) NOT NULL,
[operation_name] nvarchar(256) NOT NULL,
CONSTRAINT [PK_lookup_operation] PRIMARY KEY ([operation_id])
);
GO

View File

@@ -0,0 +1,8 @@
-- Table: lookup_package_op_status
CREATE TABLE [lookup_package_op_status] (
[status_id] int NOT NULL,
[status_name] nvarchar(50) NOT NULL,
CONSTRAINT [PK_lookup_package_op_status] PRIMARY KEY ([status_id])
);
GO

View File

@@ -0,0 +1,8 @@
-- Table: lookup_status
CREATE TABLE [lookup_status] (
[status_id] int NOT NULL,
[status_name] nvarchar(50) NOT NULL,
CONSTRAINT [PK_lookup_status] PRIMARY KEY ([status_id])
);
GO

View File

@@ -0,0 +1,7 @@
-- Table: lookup_table_name
CREATE TABLE [lookup_table_name] (
[table_id] smallint NOT NULL,
[table_name] nvarchar(250) NULL
);
GO

View File

@@ -0,0 +1,8 @@
-- Table: namespace
CREATE TABLE [namespace] (
[namespace_id] smallint NOT NULL,
[namespace_name] nvarchar(32) NULL,
CONSTRAINT [PK_namespace] PRIMARY KEY ([namespace_id])
);
GO

View File

@@ -0,0 +1,9 @@
-- Table: object_device_linkage
CREATE TABLE [object_device_linkage] (
[gobject_id] int NOT NULL,
[dio_id] int NOT NULL,
[sg_mx_primitive_id] smallint NOT NULL,
CONSTRAINT [PK_object_device_linkage] PRIMARY KEY ([gobject_id])
);
GO

View File

@@ -0,0 +1,9 @@
-- Table: object_wizard_overview_symbols
CREATE TABLE [object_wizard_overview_symbols] (
[gobject_id] int NOT NULL,
[visual_element_id] int NOT NULL,
[change_type] int NOT NULL,
[mx_primitive_id] int NULL
);
GO

View File

@@ -0,0 +1,12 @@
-- Table: object_wizard_symbol_override
CREATE TABLE [object_wizard_symbol_override] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[symbol_overrides] image(2147483647) NULL,
CONSTRAINT [PK_object_wizard_symbol_override] PRIMARY KEY ([gobject_id], [package_id], [gobject_id], [package_id])
);
GO
ALTER TABLE [object_wizard_symbol_override] ADD FOREIGN KEY ([package_id]) REFERENCES [package] ([package_id]);
GO

View File

@@ -0,0 +1,15 @@
-- Table: object_wizard_symbol_override_mapping
CREATE TABLE [object_wizard_symbol_override_mapping] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[mx_primitive_id] smallint NOT NULL,
[has_local_overrides] bit NOT NULL,
[thumbnail] image(2147483647) NULL,
[preview] image(2147483647) NULL,
CONSTRAINT [PK_object_wizard_symbol_override_mapping] PRIMARY KEY ([gobject_id], [package_id], [mx_primitive_id], [gobject_id], [mx_primitive_id], [package_id], [gobject_id], [mx_primitive_id], [package_id], [gobject_id], [mx_primitive_id], [package_id])
);
GO
ALTER TABLE [object_wizard_symbol_override_mapping] ADD FOREIGN KEY ([package_id]) REFERENCES [primitive_instance] ([package_id]);
GO

View File

@@ -0,0 +1,9 @@
-- Table: old_checked_in_packages
CREATE TABLE [old_checked_in_packages] (
[package_id] int NULL,
[gobject_id] int NULL,
[is_template] bit NULL,
[is_being_referenced] bit NULL DEFAULT ((0))
);
GO

View File

@@ -0,0 +1,13 @@
-- Table: operation
CREATE TABLE [operation] (
[operation_id] int NOT NULL,
[user_profile_id] int NOT NULL,
[operation_name] nvarchar(300) NOT NULL,
[start_time] datetime NOT NULL DEFAULT (getdate()),
CONSTRAINT [PK_operation] PRIMARY KEY ([operation_id], [user_profile_id])
);
GO
ALTER TABLE [operation] ADD FOREIGN KEY ([user_profile_id]) REFERENCES [user_profile] ([user_profile_id]);
GO

View File

@@ -0,0 +1,13 @@
-- Table: operation_message
CREATE TABLE [operation_message] (
[message_id] int NOT NULL,
[operation_id] int NOT NULL,
[message_text] nvarchar(300) NOT NULL,
[message_time] datetime NOT NULL DEFAULT (getdate()),
CONSTRAINT [PK_operation_message] PRIMARY KEY ([message_id], [operation_id])
);
GO
ALTER TABLE [operation_message] ADD FOREIGN KEY ([operation_id]) REFERENCES [operation] ([operation_id]);
GO

View File

@@ -0,0 +1,11 @@
-- Table: operation_status
CREATE TABLE [operation_status] (
[operation_id] int NOT NULL,
[status] int NOT NULL,
CONSTRAINT [PK_operation_status] PRIMARY KEY ([operation_id], [status], [operation_id])
);
GO
ALTER TABLE [operation_status] ADD FOREIGN KEY ([operation_id]) REFERENCES [operation] ([operation_id]);
GO

View File

@@ -0,0 +1,8 @@
-- Table: operation_status_look_up
CREATE TABLE [operation_status_look_up] (
[status] int NOT NULL,
[status_name] varchar(100) NOT NULL,
CONSTRAINT [PK_operation_status_look_up] PRIMARY KEY ([status])
);
GO

View File

@@ -0,0 +1,16 @@
-- Table: ow_group_def
CREATE TABLE [ow_group_def] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[ow_group_id] int NOT NULL,
[prompt] nvarchar(260) NOT NULL,
[GUID] varchar(36) NOT NULL,
[description] nvarchar(260) NULL,
[visibility_rules] nvarchar(-1) NULL,
CONSTRAINT [PK_ow_group_def] PRIMARY KEY ([gobject_id], [package_id], [ow_group_id], [ow_group_id])
);
GO
ALTER TABLE [ow_group_def] ADD FOREIGN KEY ([ow_group_id]) REFERENCES [ow_group_id] ([ow_group_id]);
GO

View File

@@ -0,0 +1,7 @@
-- Table: ow_group_id
CREATE TABLE [ow_group_id] (
[ow_group_id] int NOT NULL,
CONSTRAINT [PK_ow_group_id] PRIMARY KEY ([ow_group_id])
);
GO

View File

@@ -0,0 +1,13 @@
-- Table: ow_group_override
CREATE TABLE [ow_group_override] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[ow_group_id] int NOT NULL,
[property_bitmask] int NOT NULL,
CONSTRAINT [PK_ow_group_override] PRIMARY KEY ([gobject_id], [package_id], [ow_group_id], [ow_group_id])
);
GO
ALTER TABLE [ow_group_override] ADD FOREIGN KEY ([ow_group_id]) REFERENCES [ow_group_id] ([ow_group_id]);
GO

View File

@@ -0,0 +1,17 @@
-- Table: ow_instance_setting
CREATE TABLE [ow_instance_setting] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[name] nvarchar(329) NOT NULL,
[ow_setting_type] int NOT NULL,
[is_dmv] bit NOT NULL,
[override_value] nvarchar(-1) NULL,
[is_mx] bit NOT NULL,
[is_implicit] bit NULL,
CONSTRAINT [PK_ow_instance_setting] PRIMARY KEY ([gobject_id], [package_id], [name], [ow_setting_type], [is_dmv], [ow_setting_type])
);
GO
ALTER TABLE [ow_instance_setting] ADD FOREIGN KEY ([ow_setting_type]) REFERENCES [ow_lu_setting] ([ow_setting_type]);
GO

View File

@@ -0,0 +1,19 @@
-- Table: ow_link_def
CREATE TABLE [ow_link_def] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[ow_link_id] int NOT NULL,
[ow_link_type] int NOT NULL,
[name] nvarchar(329) NOT NULL,
[mx_primitive_id] smallint NULL,
[dynamic_attribute_id] bigint NULL,
[optional_id] int NULL,
[property_bitmask] int NOT NULL,
[sort] int NOT NULL,
CONSTRAINT [PK_ow_link_def] PRIMARY KEY ([gobject_id], [package_id], [ow_link_id], [ow_link_id])
);
GO
ALTER TABLE [ow_link_def] ADD FOREIGN KEY ([ow_link_id]) REFERENCES [ow_link_id] ([ow_link_id]);
GO

View File

@@ -0,0 +1,11 @@
-- Table: ow_link_id
CREATE TABLE [ow_link_id] (
[ow_link_id] int NOT NULL,
[ow_opt_or_choice_id] int NOT NULL,
CONSTRAINT [PK_ow_link_id] PRIMARY KEY ([ow_link_id], [ow_opt_or_choice_id])
);
GO
ALTER TABLE [ow_link_id] ADD FOREIGN KEY ([ow_opt_or_choice_id]) REFERENCES [ow_opt_or_choice_id] ([ow_opt_or_choice_id]);
GO

View File

@@ -0,0 +1,17 @@
-- Table: ow_lu_definition
CREATE TABLE [ow_lu_definition] (
[ow_setting_type] int NOT NULL,
[primitive_definition_id] int NOT NULL,
[template_definition_id] int NOT NULL,
[boolean_analog] bit NOT NULL,
[ext] varchar(20) NOT NULL,
[link_setting] int NULL,
[link_feature] int NULL,
[mx_attribute_id] smallint NULL,
CONSTRAINT [PK_ow_lu_definition] PRIMARY KEY ([ow_setting_type], [primitive_definition_id], [ow_setting_type])
);
GO
ALTER TABLE [ow_lu_definition] ADD FOREIGN KEY ([ow_setting_type]) REFERENCES [ow_lu_setting] ([ow_setting_type]);
GO

View File

@@ -0,0 +1,18 @@
-- Table: ow_lu_setting
CREATE TABLE [ow_lu_setting] (
[ow_setting_type] int NOT NULL,
[category] varchar(10) NOT NULL,
[mx_data_type] tinyint NULL,
[setting_name] nvarchar(30) NOT NULL,
[feature_id] int NULL,
[feature_sub_id] int NULL,
[parent_type] int NULL,
[no_ext] bit NULL,
[raw_value] nvarchar(100) NULL,
CONSTRAINT [PK_ow_lu_setting] PRIMARY KEY ([ow_setting_type], [mx_data_type])
);
GO
ALTER TABLE [ow_lu_setting] ADD FOREIGN KEY ([mx_data_type]) REFERENCES [data_type] ([mx_data_type]);
GO

View File

@@ -0,0 +1,21 @@
-- Table: ow_opt_or_choice_def
CREATE TABLE [ow_opt_or_choice_def] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[ow_opt_or_choice_id] int NOT NULL,
[prompt] nvarchar(260) NOT NULL,
[GUID] varchar(36) NOT NULL,
[name] varchar(10) NOT NULL,
[description] nvarchar(260) NULL,
[choice_sequence_number] int NULL,
[after_group_or_option] int NULL,
[initial_value] bit NOT NULL DEFAULT ((0)),
[visibility_rules] nvarchar(-1) NULL,
[sort] int NOT NULL,
CONSTRAINT [PK_ow_opt_or_choice_def] PRIMARY KEY ([gobject_id], [package_id], [ow_opt_or_choice_id], [ow_opt_or_choice_id])
);
GO
ALTER TABLE [ow_opt_or_choice_def] ADD FOREIGN KEY ([ow_opt_or_choice_id]) REFERENCES [ow_opt_or_choice_id] ([ow_opt_or_choice_id]);
GO

View File

@@ -0,0 +1,11 @@
-- Table: ow_opt_or_choice_id
CREATE TABLE [ow_opt_or_choice_id] (
[ow_opt_or_choice_id] int NOT NULL,
[ow_group_id] int NOT NULL,
CONSTRAINT [PK_ow_opt_or_choice_id] PRIMARY KEY ([ow_opt_or_choice_id], [ow_group_id])
);
GO
ALTER TABLE [ow_opt_or_choice_id] ADD FOREIGN KEY ([ow_group_id]) REFERENCES [ow_group_id] ([ow_group_id]);
GO

View File

@@ -0,0 +1,14 @@
-- Table: ow_opt_or_choice_override
CREATE TABLE [ow_opt_or_choice_override] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[ow_opt_or_choice_id] int NOT NULL,
[property_bitmask] int NULL,
[override_value] bit NULL,
CONSTRAINT [PK_ow_opt_or_choice_override] PRIMARY KEY ([gobject_id], [package_id], [ow_opt_or_choice_id], [ow_opt_or_choice_id])
);
GO
ALTER TABLE [ow_opt_or_choice_override] ADD FOREIGN KEY ([ow_opt_or_choice_id]) REFERENCES [ow_opt_or_choice_id] ([ow_opt_or_choice_id]);
GO

View File

@@ -0,0 +1,18 @@
-- Table: ow_setting_def
CREATE TABLE [ow_setting_def] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[ow_setting_id] int NOT NULL,
[ow_setting_type] int NOT NULL,
[reference] nvarchar(260) NULL,
[property_id] varchar(36) NULL,
[initial_value] nvarchar(-1) NULL,
[property_bitmask] int NULL,
[sort] int NOT NULL,
CONSTRAINT [PK_ow_setting_def] PRIMARY KEY ([gobject_id], [package_id], [ow_setting_id], [ow_setting_type], [ow_setting_id])
);
GO
ALTER TABLE [ow_setting_def] ADD FOREIGN KEY ([ow_setting_id]) REFERENCES [ow_setting_id] ([ow_setting_id]);
GO

View File

@@ -0,0 +1,11 @@
-- Table: ow_setting_id
CREATE TABLE [ow_setting_id] (
[ow_setting_id] int NOT NULL,
[ow_link_id] int NOT NULL,
CONSTRAINT [PK_ow_setting_id] PRIMARY KEY ([ow_setting_id], [ow_link_id])
);
GO
ALTER TABLE [ow_setting_id] ADD FOREIGN KEY ([ow_link_id]) REFERENCES [ow_link_id] ([ow_link_id]);
GO

View File

@@ -0,0 +1,14 @@
-- Table: ow_setting_override
CREATE TABLE [ow_setting_override] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[ow_setting_id] int NOT NULL,
[override_value] nvarchar(-1) NULL,
[property_bitmask] int NULL,
CONSTRAINT [PK_ow_setting_override] PRIMARY KEY ([gobject_id], [package_id], [ow_setting_id], [ow_setting_id])
);
GO
ALTER TABLE [ow_setting_override] ADD FOREIGN KEY ([ow_setting_id]) REFERENCES [ow_setting_id] ([ow_setting_id]);
GO

View File

@@ -0,0 +1,17 @@
-- Table: ow_symbol_setting
CREATE TABLE [ow_symbol_setting] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[sym_name] nvarchar(33) NOT NULL,
[ow_setting_type] int NOT NULL,
[reference] nvarchar(260) NOT NULL,
[property_id] nvarchar(36) NULL,
[value] nvarchar(-1) NULL,
[property_bitmask] int NULL,
CONSTRAINT [PK_ow_symbol_setting] PRIMARY KEY ([gobject_id], [package_id], [sym_name], [ow_setting_type], [reference], [ow_setting_type])
);
GO
ALTER TABLE [ow_symbol_setting] ADD FOREIGN KEY ([ow_setting_type]) REFERENCES [ow_lu_setting] ([ow_setting_type]);
GO

View File

@@ -0,0 +1,21 @@
-- Table: owned_visual_element
CREATE TABLE [owned_visual_element] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[mx_primitive_id] smallint NOT NULL,
[visual_element_id] int NOT NULL,
[thumbnail] image(2147483647) NULL,
[description] nvarchar(1024) NULL,
[visual_element_definition] image(2147483647) NOT NULL,
[is_thumbnail_dirty] bit NOT NULL DEFAULT ((0)),
[visual_element_definition_grm] image(2147483647) NOT NULL,
[content_type] nvarchar(1024) NULL,
[visual_element_crossRef] nvarchar(-1) NULL,
[preview] image(2147483647) NULL,
CONSTRAINT [PK_owned_visual_element] PRIMARY KEY ([gobject_id], [package_id], [mx_primitive_id], [gobject_id], [mx_primitive_id], [package_id], [gobject_id], [mx_primitive_id], [package_id], [gobject_id], [mx_primitive_id], [package_id])
);
GO
ALTER TABLE [owned_visual_element] ADD FOREIGN KEY ([package_id]) REFERENCES [visual_element_version] ([package_id]);
GO

21
gr/ddl/tables/package.sql Normal file
View File

@@ -0,0 +1,21 @@
-- Table: package
CREATE TABLE [package] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[status_id] int NOT NULL DEFAULT ((0)),
[reference_status_id] int NOT NULL DEFAULT ((0)),
[instance_attributes] image(2147483647) NULL,
[operation_status] int NOT NULL DEFAULT ((0)),
[security_group] nvarchar(32) NOT NULL DEFAULT ('Default'),
[derived_from_package_id] int NOT NULL DEFAULT ((0)),
[deployable_configuration_version] int NOT NULL DEFAULT ((0)),
[package_type] nvarchar(5) NOT NULL DEFAULT ('I'),
[package_version] smallint NOT NULL DEFAULT ((0)),
[object_status] smallint NOT NULL DEFAULT ((0)),
CONSTRAINT [PK_package] PRIMARY KEY ([gobject_id], [package_id], [gobject_id], [status_id])
);
GO
ALTER TABLE [package] ADD FOREIGN KEY ([status_id]) REFERENCES [lookup_status] ([status_id]);
GO

View File

@@ -0,0 +1,8 @@
-- Table: packages_to_be_deleted
CREATE TABLE [packages_to_be_deleted] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
CONSTRAINT [PK_packages_to_be_deleted] PRIMARY KEY ([gobject_id], [package_id])
);
GO

View File

@@ -0,0 +1,21 @@
-- Table: platform
CREATE TABLE [platform] (
[platform_id] int NOT NULL,
[platform_gobject_id] int NOT NULL,
[node_name] nvarchar(256) NOT NULL DEFAULT (''),
[last_deployed_node_name] nvarchar(256) NOT NULL DEFAULT (''),
[rmcNode_name] nvarchar(256) NOT NULL DEFAULT (''),
[last_deployed_rmcNode_name] nvarchar(256) NOT NULL DEFAULT (''),
[portNMX] int NOT NULL DEFAULT ((0)),
[last_deployed_portNMX] int NOT NULL DEFAULT ((0)),
[portRMC] int NOT NULL DEFAULT ((0)),
[last_deployed_portRMC] int NOT NULL DEFAULT ((0)),
[portRPC] int NOT NULL DEFAULT ((0)),
[last_deployed_portRPC] int NOT NULL DEFAULT ((0)),
CONSTRAINT [PK_platform] PRIMARY KEY ([platform_gobject_id], [platform_gobject_id])
);
GO
ALTER TABLE [platform] ADD FOREIGN KEY ([platform_gobject_id]) REFERENCES [gobject] ([gobject_id]);
GO

View File

@@ -0,0 +1,11 @@
-- Table: platform_license
CREATE TABLE [platform_license] (
[gobject_id] int NOT NULL,
[license_type] int NOT NULL,
CONSTRAINT [PK_platform_license] PRIMARY KEY ([gobject_id], [gobject_id])
);
GO
ALTER TABLE [platform_license] ADD FOREIGN KEY ([gobject_id]) REFERENCES [gobject] ([gobject_id]);
GO

View File

@@ -0,0 +1,15 @@
-- Table: primitive_attribute_validation_results
CREATE TABLE [primitive_attribute_validation_results] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[mx_primitive_id] smallint NOT NULL,
[mx_attribute_id] smallint NOT NULL,
[validationCode] nvarchar(329) NOT NULL,
[validationState] smallint NOT NULL,
CONSTRAINT [PK_primitive_attribute_validation_results] PRIMARY KEY ([gobject_id], [package_id], [mx_primitive_id], [mx_attribute_id], [validationCode], [gobject_id], [mx_primitive_id], [package_id], [gobject_id], [mx_primitive_id], [package_id], [gobject_id], [mx_primitive_id], [package_id])
);
GO
ALTER TABLE [primitive_attribute_validation_results] ADD FOREIGN KEY ([package_id]) REFERENCES [primitive_instance] ([package_id]);
GO

View File

@@ -0,0 +1,11 @@
-- Table: primitive_data_type
CREATE TABLE [primitive_data_type] (
[mx_data_type] tinyint NOT NULL,
[primitive_definition_id] int NOT NULL,
CONSTRAINT [PK_primitive_data_type] PRIMARY KEY ([mx_data_type], [primitive_definition_id], [mx_data_type], [primitive_definition_id])
);
GO
ALTER TABLE [primitive_data_type] ADD FOREIGN KEY ([primitive_definition_id]) REFERENCES [primitive_definition] ([primitive_definition_id]);
GO

View File

@@ -0,0 +1,21 @@
-- Table: primitive_definition
CREATE TABLE [primitive_definition] (
[primitive_definition_id] int NOT NULL,
[template_definition_id] int NOT NULL,
[parent_mx_primitive_id] smallint NOT NULL,
[mx_primitive_id] smallint NOT NULL DEFAULT ((0)),
[primitive_name] nvarchar(329) NOT NULL DEFAULT (''),
[execution_group] smallint NOT NULL,
[is_virtual] bit NOT NULL,
[primitive_guid] uniqueidentifier NOT NULL,
[runtime_handler_clsid] uniqueidentifier NULL,
[package_handler_clsid] uniqueidentifier NULL,
[supports_dynamic_attributes] bit NOT NULL,
[major_version] int NOT NULL,
CONSTRAINT [PK_primitive_definition] PRIMARY KEY ([primitive_definition_id], [template_definition_id])
);
GO
ALTER TABLE [primitive_definition] ADD FOREIGN KEY ([template_definition_id]) REFERENCES [template_definition] ([template_definition_id]);
GO

View File

@@ -0,0 +1,34 @@
-- Table: primitive_instance
CREATE TABLE [primitive_instance] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[mx_primitive_id] smallint NOT NULL,
[primitive_definition_id] int NOT NULL,
[primitive_name] nvarchar(329) NOT NULL,
[parent_mx_primitive_id] smallint NOT NULL,
[execution_group] int NOT NULL,
[execution_order] int NOT NULL DEFAULT ((-1)),
[owned_by_gobject_id] int NOT NULL DEFAULT ((0)),
[timestamp_of_last_change] bigint NULL DEFAULT ((0)),
[max_child_timestamp] bigint NULL DEFAULT ((0)),
[extension_type] nvarchar(329) NULL,
[is_object_extension] bit NULL DEFAULT ((0)),
[checked_in_primitive_version] int NOT NULL DEFAULT ((1)),
[checked_out_primitive_version] int NOT NULL DEFAULT ((1)),
[entity_change_type] int NOT NULL DEFAULT ((1)),
[operation_on_primitive_mask] int NOT NULL DEFAULT ((0)),
[created_by_parent] smallint NOT NULL DEFAULT ((0)),
[status_id] smallint NOT NULL DEFAULT ((0)),
[ref_status_id] smallint NOT NULL DEFAULT ((0)),
[primitive_attributes] image(2147483647) NULL,
[mx_value_errors] text(2147483647) NOT NULL,
[mx_value_warnings] text(2147483647) NOT NULL,
[mx_value_reference_warnings] text(2147483647) NOT NULL,
[property_bitmask] smallint NOT NULL DEFAULT ((0)),
CONSTRAINT [PK_primitive_instance] PRIMARY KEY ([gobject_id], [package_id], [mx_primitive_id], [gobject_id], [package_id], [gobject_id], [package_id])
);
GO
ALTER TABLE [primitive_instance] ADD FOREIGN KEY ([package_id]) REFERENCES [package] ([package_id]);
GO

View File

@@ -0,0 +1,15 @@
-- Table: primitive_instance_feature_link
CREATE TABLE [primitive_instance_feature_link] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[mx_primitive_id] smallint NOT NULL,
[feature_id] int NOT NULL,
[feature_name] nvarchar(256) NOT NULL DEFAULT (''),
[feature_type] nvarchar(256) NOT NULL DEFAULT (''),
CONSTRAINT [PK_primitive_instance_feature_link] PRIMARY KEY ([gobject_id], [package_id], [mx_primitive_id], [feature_id], [feature_id], [gobject_id], [mx_primitive_id], [package_id], [gobject_id], [mx_primitive_id], [package_id], [gobject_id], [mx_primitive_id], [package_id])
);
GO
ALTER TABLE [primitive_instance_feature_link] ADD FOREIGN KEY ([package_id]) REFERENCES [primitive_instance] ([package_id]);
GO

View File

@@ -0,0 +1,16 @@
-- Table: primitive_instance_file_table_link
CREATE TABLE [primitive_instance_file_table_link] (
[gobject_id] int NOT NULL,
[package_id] int NOT NULL,
[mx_primitive_id] smallint NOT NULL,
[file_id] int NOT NULL,
[is_needed_for_package] bit NOT NULL DEFAULT ((0)),
[is_needed_for_runtime] bit NOT NULL DEFAULT ((0)),
[is_needed_for_editor] bit NOT NULL DEFAULT ((0)),
CONSTRAINT [PK_primitive_instance_file_table_link] PRIMARY KEY ([gobject_id], [package_id], [mx_primitive_id], [file_id], [file_id], [gobject_id], [mx_primitive_id], [package_id], [gobject_id], [mx_primitive_id], [package_id], [gobject_id], [mx_primitive_id], [package_id])
);
GO
ALTER TABLE [primitive_instance_file_table_link] ADD FOREIGN KEY ([package_id]) REFERENCES [primitive_instance] ([package_id]);
GO

View File

@@ -0,0 +1,9 @@
-- Table: proxy_timestamp
CREATE TABLE [proxy_timestamp] (
[gobject_id] int NOT NULL,
[timestamp_of_last_change] timestamp NOT NULL,
[ImportGUID] nvarchar(265) NULL,
CONSTRAINT [PK_proxy_timestamp] PRIMARY KEY ([gobject_id])
);
GO

Some files were not shown because too many files have changed in this diff Show More