CRITFC / Helpdesk

Parent repository for tribal CDMS documentation and issues
1 stars 0 forks source link

CDMS 2.2 Dataset Builder #33

Closed nowinski closed 3 years ago

nowinski commented 4 years ago

Error when attempting to create a column named "Comments" in dataset builder.

Capture

Main dataset view already has a column with that name (ActivitiesQA table Comments). Traced to DatabaseTableHelper.cs line 84.

Column is created on the table and record created in Fields table and appears on the Admin Datastore fields screen. After manually deleting table column db (header table), received error message when attempting to delete row from Datastore fields grid:

Capture

Okay--normally, users won't be manually dropping columns from tables but still propose changing DatabaseColumnHelper.cs line 30 from

var query = "ALTER TABLE " + tableName + " DROP COLUMN " + in_field.DbColumnName;

to

var query = "ALTER TABLE " + tableName + " DROP COLUMN IF EXISTS " + in_field.DbColumnName;

nowinski commented 4 years ago

Error when attempting to remove datastore column after a project dataset has been created. DatastoreController.cs RemoveMasterField method attempts to delete Field record before deleting related DatasetField records.

The DELETE statement conflicted with the REFERENCE constraint "FK_dbo.DatasetFields_dbo.Fields_FieldId"

Proposed fix:

Capture