What is the equivalent of this in postgresql ?
--
-- Index for the table `Artist`
--
ALTER TABLE `Artist`
ADD PRIMARY KEY (`idArtist`),
ADD UNIQUE KEY `name` (`name`,`firstName`);
ADD KEY `idFilm` (`idFilm`);
What is the equivalent of this in postgresql ?
--
-- Index for the table `Artist`
--
ALTER TABLE `Artist`
ADD PRIMARY KEY (`idArtist`),
ADD UNIQUE KEY `name` (`name`,`firstName`);
ADD KEY `idFilm` (`idFilm`);
Adding a primary key is the same.
alter table artist
add primary key (idartist);
For the unique constraint you have two choices:
alter table artist
add constraint name unique (name, firstname);
or a unique index:
create unique index name on artist (name, firstname);
I think the key
thing, simply adds a regular index:
create index idfilm on artist (idfilm);