Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 149509 Details for
Bug 292146
[DB] create unique constraints on table PKs to prevent data corruption
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch-v2
clipboard.txt (text/plain), 3.27 KB, created by
Stefan Winkler
on 2009-10-14 06:13:54 EDT
(
hide
)
Description:
Patch-v2
Filename:
MIME Type:
Creator:
Stefan Winkler
Created:
2009-10-14 06:13:54 EDT
Size:
3.27 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.emf.cdo.server.db >Index: src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractListTableMapping.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractListTableMapping.java,v >retrieving revision 1.6 >diff -u -r1.6 AbstractListTableMapping.java >--- src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractListTableMapping.java 23 May 2009 17:26:27 -0000 1.6 >+++ src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractListTableMapping.java 14 Oct 2009 10:15:15 -0000 >@@ -103,7 +103,7 @@ > > // add fields for keys (cdo_id, version, feature_id) > FieldInfo[] fields = getKeyFields(); >- IDBField[] dbFields = new IDBField[fields.length]; >+ IDBField[] dbFields = new IDBField[fields.length + 1]; > > for (int i = 0; i < fields.length; i++) > { >@@ -111,15 +111,14 @@ > } > > // add field for list index >- IDBField idxField = table.addField(CDODBSchema.LIST_IDX, DBType.INTEGER); >+ dbFields[dbFields.length - 1] = table.addField(CDODBSchema.LIST_IDX, DBType.INTEGER); > > // add field for value > typeMapping = mappingStrategy.createValueMapping(feature); > typeMapping.createDBField(table, CDODBSchema.LIST_VALUE); > > // add table indexes >- table.addIndex(Type.NON_UNIQUE, dbFields); >- table.addIndex(Type.NON_UNIQUE, idxField); >+ table.addIndex(Type.UNIQUE, dbFields); > } > > protected abstract FieldInfo[] getKeyFields(); >Index: src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java,v >retrieving revision 1.4.2.2 >diff -u -r1.4.2.2 AbstractHorizontalClassMapping.java >--- src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java 25 Sep 2009 10:28:15 -0000 1.4.2.2 >+++ src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java 14 Oct 2009 10:15:15 -0000 >@@ -86,7 +86,7 @@ > table = getMappingStrategy().getStore().getDBSchema().addTable(name); > > IDBField idField = table.addField(CDODBSchema.ATTRIBUTES_ID, DBType.BIGINT, true); >- table.addField(CDODBSchema.ATTRIBUTES_VERSION, DBType.INTEGER, true); >+ IDBField versionField = table.addField(CDODBSchema.ATTRIBUTES_VERSION, DBType.INTEGER, true); > table.addField(CDODBSchema.ATTRIBUTES_CLASS, DBType.BIGINT, true); > table.addField(CDODBSchema.ATTRIBUTES_CREATED, DBType.BIGINT, true); > IDBField revisedField = table.addField(CDODBSchema.ATTRIBUTES_REVISED, DBType.BIGINT, true); >@@ -94,6 +94,7 @@ > table.addField(CDODBSchema.ATTRIBUTES_CONTAINER, DBType.BIGINT, true); > table.addField(CDODBSchema.ATTRIBUTES_FEATURE, DBType.INTEGER, true); > >+ table.addIndex(IDBIndex.Type.UNIQUE, idField, versionField); > table.addIndex(IDBIndex.Type.NON_UNIQUE, idField, revisedField); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 292146
:
149439
| 149509