Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Standard schemas to ECXML 3.2. #136

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions SchemaInventory.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "CoreCustomAttributes",
"path": "Standard\\CoreCustomAttributes.ecschema.xml",
"released": false,
"version": "01.00.03",
"version": "01.00.04",
"comment": "Working Copy",
"sha1": "",
"author": "",
Expand Down Expand Up @@ -144,7 +144,7 @@
"name": "SchemaLocalizationCustomAttributes",
"path": "Standard\\SchemaLocalizationCustomAttributes.ecschema.xml",
"released": false,
"version": "01.00.00",
"version": "01.00.01",
"comment": "Working Copy",
"sha1": "",
"author": "",
Expand Down Expand Up @@ -348,6 +348,18 @@
"approved": "No ",
"version": "02.00.01",
"released": true
},
{
"name": "ECDbMap",
"path": "Standard\\ECDb\\ECDbMap.ecschema.xml",
"released": false,
"version": "02.00.01",
"comment": "Working Copy",
"sha1": "",
"author": "Diego.Diaz",
"approved": "No",
"date": "Unknown",
"dynamic": "No"
}
],
"ECDbMeta": [
Expand Down Expand Up @@ -394,6 +406,18 @@
"date": "Unknown",
"dynamic": "No",
"approved": "Yes"
},
{
"name": "ECDbSchemaPolicies",
"path": "Standard\\ECDb\\ECDbSchemaPolicies.ecschema.xml",
"released": false,
"version": "01.00.01",
"comment": "Working Copy",
"sha1": "",
"author": "Diego.Diaz",
"approved": "No",
"date": "Unknown",
"dynamic": "No"
}
],
"ECDbSystem": [
Expand Down
22 changes: 11 additions & 11 deletions Standard/CoreCustomAttributes.ecschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
| * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
| * See LICENSE.md in the project root for license terms and full copyright notice.
======================================================================================= -->
<ECSchema schemaName="CoreCustomAttributes" alias="CoreCA" version="01.00.03" description="Custom attributes to indicate core EC concepts, may include struct classes intended for use in core custom attributes." displayLabel="Core Custom Attributes" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.1">
<ECSchema schemaName="CoreCustomAttributes" alias="CoreCA" version="01.00.04" description="Custom attributes to indicate core EC concepts, may include struct classes intended for use in core custom attributes." displayLabel="Core Custom Attributes" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
<ECCustomAttributeClass typeName="DynamicSchema" description="Identifies a schema as dynamically generated by an application. Like versions of a schema may differ and are not guaranteed to merge without conflicts." displayLabel="Dynamic Schema" appliesTo="Schema" modifier="Sealed"/>
<ECCustomAttributeClass typeName="PartialSchema" description="Identifies a schema file/object that may only contain part of the complete schema. Like versions of a schema may differ but are guaranteed to merge without conflicts." displayLabel="Partial Schema" appliesTo="Schema" modifier="Sealed"/>
<ECStructClass typeName="SchemaNameAndPurpose" description="Used to define a supplemental schema and its purpose" modifier="Sealed">
Expand All @@ -29,14 +29,14 @@
<ECProperty propertyName="DateTimeComponent" typeName="DateTimeComponent" description="Either DateTime or Date. Default: DateTime. Specifying 'Date' usually implies that a DateTimeKind is irrelevant, because dates (without time) don't need any timezone information."/>
</ECCustomAttributeClass>
<ECEnumeration typeName="DateTimeKind" backingTypeName="string" isStrict="true">
<ECEnumerator value="Unspecified"/>
<ECEnumerator value="Utc"/>
<ECEnumerator value="Local"/>
<ECEnumerator value="Unspecified" name="Unspecified"/>
<ECEnumerator value="Utc" name="Utc"/>
<ECEnumerator value="Local" name="Local"/>
</ECEnumeration>
<ECEnumeration typeName="DateTimeComponent" backingTypeName="string" isStrict="true">
<ECEnumerator value="DateTime"/>
<ECEnumerator value="Date"/>
<ECEnumerator value="TimeOfDay"/>
<ECEnumerator value="DateTime" name="DateTime"/>
<ECEnumerator value="Date" name="Date"/>
<ECEnumerator value="TimeOfDay" name="TimeOfDay"/>
</ECEnumeration>
<ECCustomAttributeClass typeName="ClassHasCurrentTimeStampProperty" appliesTo="EntityClass" modifier="Sealed">
<ECProperty propertyName="PropertyName" typeName="string"/>
Expand Down Expand Up @@ -65,10 +65,10 @@
</ECCustomAttributeClass>

<ECEnumeration typeName="ProductionStatusValue" backingTypeName="string" isStrict="true" description="Used with ProductionStatus to declare the schema author's intended and supported workflows for the schema.">
<ECEnumerator displayLabel="NotForProduction" value="NotForProduction"/> <!-- description="This schema is under development and should not be used for production workflows. Data created using this schema is not supported and may not be upgradable." -->
<ECEnumerator displayLabel="FieldTesting" value="FieldTesting" /> <!-- description="This schema is suitable for field testing of production workflows. Data created with the schema is not supported long-term and may not be upgradable." -->
<ECEnumerator displayLabel="Production" value="Production" /> <!-- description="This schema is suitable for production workflows. Data created using this schema will be supported long term (possibly through transformation)." -->
<ECEnumerator displayLabel="Deprecated" value="Deprecated" /> <!-- description="This schema is no longer recommended for production workflows. Better alternatives exist and should be used instead." -->
<ECEnumerator name="NotForProduction" value="NotForProduction"/> <!-- description="This schema is under development and should not be used for production workflows. Data created using this schema is not supported and may not be upgradable." -->
<ECEnumerator name="FieldTesting" value="FieldTesting" /> <!-- description="This schema is suitable for field testing of production workflows. Data created with the schema is not supported long-term and may not be upgradable." -->
<ECEnumerator name="Production" value="Production" /> <!-- description="This schema is suitable for production workflows. Data created using this schema will be supported long term (possibly through transformation)." -->
<ECEnumerator name="Deprecated" value="Deprecated" /> <!-- description="This schema is no longer recommended for production workflows. Better alternatives exist and should be used instead." -->
</ECEnumeration>

<ECCustomAttributeClass typeName="ProductionStatus" appliesTo="Schema" modifier="Sealed" description="Declares the suitability of this schema for use in production and other workflows.">
Expand Down
54 changes: 54 additions & 0 deletions Standard/ECDb/ECDbMap.ecschema.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ==================================================================================
| * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
| * See LICENSE.md in the project root for license terms and full copyright notice.
======================================================================================= -->
<ECSchema schemaName="ECDbMap" alias="ecdbmap" version="02.00.01" description="Custom attributes that customize ECDb's ECSchema to database mapping." displayLabel="ECDb DB Mapping" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
<ECCustomAttributeClass typeName="SchemaMap" modifier="Sealed" appliesTo="Schema">
<ECProperty propertyName="TablePrefix" typeName="string" description="Specifies a prefix for generated tables. If not specified, the alias of the ECSchema is used"/>
</ECCustomAttributeClass>

<ECCustomAttributeClass typeName="ClassMap" modifier="Sealed" appliesTo="EntityClass, RelationshipClass">
<ECProperty propertyName="MapStrategy" typeName="string" description="Defines how the ECClass is mapped to table(s). Values: OwnTable (default), TablePerHierarchy, ExistingTable, NotMapped"/>
<ECProperty propertyName="TableName" typeName="string" description="If MapStrategy is 'ExistingTable' provide the table name here. Must not be set in all other cases."/>
<ECProperty propertyName="ECInstanceIdColumn" typeName="string" description="Optionally specify the name of custom 'primary key' column which must be of type Int64."/>
</ECCustomAttributeClass>

<ECCustomAttributeClass typeName="JoinedTablePerDirectSubclass" description="Maps subclasses and their children to a joined table. Can only be applied to classes in a hierarchy using MapStrategy TablePerHierarchy." modifier="Sealed" appliesTo="EntityClass"/>

<ECCustomAttributeClass typeName="ShareColumns" description="Allows to share columns amongst ECProperties. Can only be applied to MapStrategy TablePerHierarchy" modifier="Sealed" appliesTo="EntityClass, RelationshipClass">
<ECProperty propertyName="ApplyToSubclassesOnly" typeName="boolean" description="False (Default):Columns are shared for the properties of the ECClass to which this CA is applied and all its subclasses. True: Columns are not shared for this ECClass but for all of its subclasses."/>
<ECProperty propertyName="MaxSharedColumnsBeforeOverflow" typeName="int" description="Maximum number of shared columns to use before using an overflow table (optional). If not specified, ECDb will create as many shared columns until the table has 63 columns."/>
</ECCustomAttributeClass>

<ECCustomAttributeClass typeName="DbIndexList" modifier="Sealed" appliesTo="EntityClass, RelationshipClass">
<ECStructArrayProperty propertyName="Indexes" typeName="DbIndex" description="List of indexes on properties of this class. It can be use to improve query performance or to add unique constraint." minOccurs="1" maxOccurs="unbounded"/>
</ECCustomAttributeClass>

<ECStructClass typeName="DbIndex" description="Specify a database index for an ECClass." modifier="Sealed">
<ECProperty propertyName="Name" typeName="string" description="Name of the index. Must follow EC identifier rules. It needs to be globally unique in the database."/>
<ECProperty propertyName="IsUnique" typeName="boolean" description="Default: false. If true, all values in the indexed properties must be unique."/>
<ECArrayProperty propertyName="Properties" typeName="string" description="List of properties that make up the index. Only properties of primitive type are supported." minOccurs="1" maxOccurs="unbounded"/>
<ECProperty propertyName="Where" typeName="string" description="Where constraint for index"/>
</ECStructClass>

<ECCustomAttributeClass typeName="PropertyMap" modifier="Sealed" appliesTo="PrimitiveProperty">
<ECProperty propertyName="ColumnName" typeName="string" description="If not specified, the ECProperty name is used. It must follow EC Identifier specification."/>
<ECProperty propertyName="IsNullable" typeName="boolean" description="If false, values must not be unset for this property."/>
<ECProperty propertyName="IsUnique" typeName="boolean" description="Only allow unique values for this property."/>
<ECProperty propertyName="Collation" typeName="string" description="Specifies how string comparisons should work for this property. Possible values: Binary (default): bit to bit matching. NoCase: The same as binary, except that the 26 upper case characters of ASCII are folded to their lower case equivalents before comparing. Note that it only folds ASCII characters. RTrim: The same as binary, except that trailing space characters are ignored."/>
</ECCustomAttributeClass>

<ECCustomAttributeClass typeName="ForeignKeyConstraint" modifier="Sealed" appliesTo="NavigationProperty" description="Creates a foreign key for this navigation property.">
<ECProperty propertyName="OnDeleteAction" typeName="string" description="Possible values: NoAction (default), Cascade (which deletes child rows when parent row is deleted), SetNull(foreign key property in child is set to NULL), Restrict (cannot delete parent if it still has children)."/>
<ECProperty propertyName="OnUpdateAction" typeName="string" description="Possible values: NoAction (default), Cascade (which updates child foreign key when parent primary key is updated)."/>
</ECCustomAttributeClass>

<ECCustomAttributeClass typeName="LinkTableRelationshipMap" modifier="Sealed" appliesTo="RelationshipClass">
<ECProperty propertyName="SourceECInstanceIdColumn" typeName="string" description="Optional. If not set, a default column name will be used"/>
<ECProperty propertyName="TargetECInstanceIdColumn" typeName="string" description="Optional. If not set, a default column name will be used"/>
<ECProperty propertyName="CreateForeignKeyConstraints" typeName="boolean" description="Default: true. If set to false, no foreign key constraints are created on the link table. In that case, deleting instance does not delete its relationships in the link table."/>
<ECProperty propertyName="AllowDuplicateRelationships" typeName="boolean" description="Default: false. If set to true duplicate relationships are allowed."/>
</ECCustomAttributeClass>

</ECSchema>
24 changes: 24 additions & 0 deletions Standard/ECDb/ECDbSchemaPolicies.ecschema.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ==================================================================================
| * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
| * See LICENSE.md in the project root for license terms and full copyright notice.
======================================================================================= -->
<ECSchema schemaName="ECDbSchemaPolicies" alias="ecdbpol" version="01.00.01" description="Schema policies which impose schema authoring rules." displayLabel="ECDb Schema Policies" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">

<ECCustomAttributeClass typeName="NoAdditionalForeignKeyConstraints" modifier="Sealed" appliesTo="Schema"
description="If opted-in by a schema, other schemas may not define additional ECDbMap:ForeignKeyConstraint custom attributes.">
<ECArrayProperty propertyName="Exceptions" typeName="string" minOccurs="0" maxOccurs="unbounded"
description="Navigation properties that are allowed violate against the policy. Format: {schema name}:{class name}.{property name}"/>
</ECCustomAttributeClass>

<ECCustomAttributeClass typeName="NoAdditionalLinkTables" modifier="Sealed" appliesTo="Schema"
description="If opted-in by a schema, other schemas may not define ECRelationshipClasses that cause new link tables to be created.">
<ECArrayProperty propertyName="Exceptions" typeName="string" minOccurs="0" maxOccurs="unbounded" description="Relationship classes that that are allowed to violate against the policy. Format: {schema name}:{relationship class name}"/>
</ECCustomAttributeClass>

<ECCustomAttributeClass typeName="NoAdditionalRootEntityClasses" modifier="Sealed" appliesTo="Schema"
description="If opted-in by a schema, other schemas may not define entity classes that do not subclass from existing classes (mixins are excluded from this policy).">
<ECArrayProperty propertyName="Exceptions" typeName="string" minOccurs="0" maxOccurs="unbounded"
description="Entity classes that that are allowed to violate against the policy. Format: {schema name}:{class name}"/>
</ECCustomAttributeClass>
</ECSchema>
2 changes: 1 addition & 1 deletion Standard/SchemaLocalizationCustomAttributes.ecschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
| * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
| * See LICENSE.md in the project root for license terms and full copyright notice.
======================================================================================= -->
<ECSchema schemaName="SchemaLocalizationCustomAttributes" alias="LocCA" version="01.00.00" description="Custom attributes used for schema localization" displayLabel="Schema Localization Custom Attributes" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.1">
<ECSchema schemaName="SchemaLocalizationCustomAttributes" alias="LocCA" version="01.00.01" description="Custom attributes used for schema localization" displayLabel="Schema Localization Custom Attributes" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
<!--Struct used for key value pair specification-->
<ECStructClass typeName="LocalizationData" description="Contains a localized value and a key that identifies it. The key may be a GUID or the original value. If the value is a GUID 'IsGUID' is true." displayLabel="Localization Data">
<ECProperty propertyName="Key" typeName="string"/>
Expand Down