mathesar icon indicating copy to clipboard operation
mathesar copied to clipboard

Disable removing dynamic default value for primary keys, allow editing PK column in new un-saved rows if no default value is set

Open pavish opened this issue 2 years ago • 2 comments

Current behavior

  • We allow editing/removing default values for all columns, including PK columns.
  • We do not allow editing cells for PK columns.

Bugs due to the current behavior

  • Users are able to remove a dynamic default value for PK columns. Once removed, adding any new row will fail.
  • If no default value is present for a PK column, adding a new row will fail. Since we do not allow editing PK column cells, users will never be able to add a new row.

Expected behavior

  • Users should not be able to remove/modify a dynamic default value of a PK column.
  • Users should be able to edit a PK column cell in an un-saved row. They should not be allowed to do that for saved rows.

pavish avatar May 06 '22 07:05 pavish

Related: #1362, #1361

seancolsen avatar May 06 '22 15:05 seancolsen

Blocked by https://github.com/centerofci/mathesar/issues/1672

pavish avatar Oct 12 '22 12:10 pavish

I've done some research and exploration on this today and am closing this ticket with the following findings:

  • Users should not be able to remove/modify a dynamic default value of a PK column.

    I've tested this and not been able to identify any UI that allows users to remove/modify dynamic default values in PK columns. I suspect the reporting of this issue came from before our Table Inspector changes.

  • Users should be able to edit a PK column cell in an un-saved row. They should not be allowed to do that for saved rows. Creating records via the Record Selector should also work smoothly when supplying PK values

    I opened #2336 to discuss these points in more detail.

seancolsen avatar Jan 23 '23 19:01 seancolsen