Re: [N-PHP-R] Help with MySQL
| From: | Nicole Amashta | Date: | Fri, 01 Mar 2002 14:52:03 +0000 |
| Subject: | Re: [N-PHP-R] Help with MySQL | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-12378@lists.php.net to get a copy of this message | ||
Oh yeah, and to drop the index, I just did this:
alter table ftp drop index username
I don't ever remember making an index called username, but perhaps I did.
Either way, it was a unique index against the login. I don't want to have
unique logins because this table holds info about ftp from different ftp
sites, so it doesn't make since to make a unique constraint on that field.
Now, I will make it unique per (account,login). Maybe.
Thanks again all,
nix
www.aeontrek.com
=======================
"B.A.T. Svensson" <B.A.T.Svensson@lumc.nl> wrote in message
news:27E647E5629ED211BF78009027289C6303C1B73E@mail1...
> >> >ALTER table balh chage column foo foo int(5)unsigned
> >>
> >> Does the key word CHANGE COLUMN really exists with in MySQL?? That
would
> be
> >> amazing to be ale to change the domain of an attribute just like that.
> >>
> >Yep
> >Syntax (Nicole, this is the correct syntax by the way... :-) :
> >
> >ALTER TABLE table_name CHANGE orig_col_name new_col_name
> >new_col_attributes
> >
> >In fact, the column must be defined again from scratch, no attributes are
> >carried over from the previous definition if you ALTER it.
>
> Which suggest that the RDBMS internally first makes a DROP COLUMN, and
then
> perform an ADD COLUMN, well, if the column attributes is not preserved,
then
> I would like to suggest to use "ALTER TABLE <table name> DROP CONSTRAINT
> <constraint>" to change a constraint - this will keeps the attributes.
>
> Second reason for not using CHANGE COLUMN would then be to keep
> compatibility between different platforms.