[Phpmyadmin-devel] about the central columns table
Marc Delisle
marc at infomarc.info
Sun May 25 13:45:24 CEST 2014
Le 2014-05-25 06:48, Smita a écrit :
>
>
> On Sat, May 24, 2014 at 11:53 PM, Smita <kumarismita62 at gmail.com
> <mailto:kumarismita62 at gmail.com>> wrote:
>
>
>
> On Sat, May 24, 2014 at 10:25 PM, Marc Delisle <marc at infomarc.info
> <mailto:marc at infomarc.info>> wrote:
>
> Le 2014-05-24 12:16, Smita a écrit :
> >
> >
> > On Sat, May 24, 2014 at 9:24 PM, Marc Delisle
> <marc at infomarc.info <mailto:marc at infomarc.info>
> > <mailto:marc at infomarc.info <mailto:marc at infomarc.info>>> wrote:
> >
> > Le 2014-05-24 11:03, Smita a écrit :
> > >
> > >
> > > On Sat, May 24, 2014 at 7:49 PM, Marc Delisle
> <marc at infomarc.info <mailto:marc at infomarc.info>
> > <mailto:marc at infomarc.info <mailto:marc at infomarc.info>>
> > > <mailto:marc at infomarc.info <mailto:marc at infomarc.info>
> <mailto:marc at infomarc.info <mailto:marc at infomarc.info>>>> wrote:
> > >
> > > Hi Smita,
> > > I have a doubt, looking at the structure you chose
> for this table:
> > > db_name
> > > column_list
> > >
> > > This structure implies that, for any change, you
> have to load a
> > > potentially big row, decode it and encode it.
> Imagine that
> > there are
> > > hundreds or thousands of column definitions for this db.
> > >
> > > I suggest something like:
> > >
> > > db_name
> > > column_name
> > > column_attributes
> > >
> > > Yeah, agree. Thanks, It would be better to keep this. :-).
> > > I have a question: If we have "id interger(11) not null
> > auto_increment"
> > > already existing in central list, should we allow to add
> another
> > column
> > > "id integer(20) not null auto_increment" ? If we don't
> allow then
> > we can
> > > also keep structure like maybe:
> > > db_name
> > > column_name
> > > column_type
> > > column_collation
> > > column_isNull
> > > column_extra
> > >
> > > - Smita
> > >
> >
> > In a central list, there should be only one column named
> "id" (but this
> > choice of name would be problematic, of course; a better
> choice would be
> > "customer_id").
> >
> > So We'll allow only unique column name. If same column name with
> > different definition tried to add we just show the column name
> (with
> > defination) already exist?
>
> Yes; eventually I guess that in your project, there will be a way to
> directly view the central list and change column definitions.
>
> Yeah, I need to make a page to manage central columns, there users
> can view complete list of columns and edit some if they want.
>
> >
> > Another example is "phone_number"; which is reused in the
> customer table
> > and in the salesperson table. You might want to always use
> CHAR(25) for
> > phone numbers.
> >
> > So it's a good idea to split the attributes into separate
> columns like
> > in your example. The default value could be there too.
> >
> > Ok, thanks. We'll keep default as well.
>
>
> Hi Marc,
> I redesigned the database as discussed. I completed the adding columns
> part but I got stuck when came to deletion. I have a question.
> Let say I have two tables tbl1 and tbl2, both table has a common column
> name "phone_number". So If user selects both tables and asks to add
> unique columns to central list, then we are gonna add just one
> "phone_number" , let say we add the column/definition "phone_number"
> from tbl1. now let say user select tbl2 and ask to remove columns from
> central list. What should it do ? should it remove the column
> "phone_number" from central list or not ? as "phone_number" was added
> from tbl1. but "phone_number" exists in tbl2 as well.
>
> - Smita
I say we should remove it from the central list. It's up to the user, to
use the feature in a correct way.
Anyway, say the user added phone_number in tbl3 but never used any
central column option on tbl3. phpMyAdmin won't know that this
phone_number in tbl3 possibly has a different definition, unless there
is an option to manually validate all the tables against the central list.
--
Marc Delisle | phpMyAdmin
More information about the Developers
mailing list