Thread: Looking for suggestions about how should I implement an action at database designer UI

In a relationship between tables, I need to allow use of existing columns as destination target of my foreign key columns.
Right now, when a user create a relationship between two tables, he should select kind: from fk or from uk ( and which?) and the fk columns are created in an automatic way at destination table.

This new feature will require a mapping between this new fk columns and existing columns, allowing user to choose which fk columns will create an automatic column at destination table, and which column will use a existing column as fk. 

My question is how to do this process, I suggest two ways:

(1) User create a relationship between (dragging mouse) and when he drop relationship end instead of creating automatic fk, a new dialog starts a allow user to choose the mapping between each column in fk at destination table between two options: choose an existing column, create an automatic one.

(2) User create a relationship between (dragging mouse) and when he drop relationship all fk columns are automatically created, if user wants to mapping a fk from a new automatic column or to an existing column,  he should select an option from right click to allow bring a dialog as described above to do this mapping.

Dialog in both cases will be like:

[origin fk column 1]     select mapping between [ automatic fk col and an existing column  ]
[origin fk column 2]     select mapping between [ automatic fk col and an existing column  ]
...

Any suggestions or advices are welcome.

Regards, Luis.
On Tue, 2011-06-14 at 00:01 -0430, Luis Ochoa wrote:
> In a relationship between tables, I need to allow use of existing
> columns as destination target of my foreign key columns.
> Right now, when a user create a relationship between two tables, he
> should select kind: from fk or from uk ( and which?) and the fk
> columns are created in an automatic way at destination table.
>
> This new feature will require a mapping between this new fk columns
> and existing columns, allowing user to choose which fk columns will
> create an automatic column at destination table, and which column will
> use a existing column as fk.
>
> My question is how to do this process, I suggest two ways:
>
> (1) User create a relationship between (dragging mouse) and when he
> drop relationship end instead of creating automatic fk, a new dialog
> starts a allow user to choose the mapping between each column in fk at
> destination table between two options: choose an existing column,
> create an automatic one.
>
> (2) User create a relationship between (dragging mouse) and when he
> drop relationship all fk columns are automatically created, if user
> wants to mapping a fk from a new automatic column or to an existing
> column,  he should select an option from right click to allow bring a
> dialog as described above to do this mapping.
>
> Dialog in both cases will be like:
>
> [origin fk column 1]     select mapping between [ automatic fk col and
> an existing column  ]
> [origin fk column 2]     select mapping between [ automatic fk col and
> an existing column  ]
> ...
>
> Any suggestions or advices are welcome.
>

I prefer #1. With #2, the user will have to delete a column he never
asked to create.


--
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com