updating imdb script
new import script
alter table movies add (imdb_title varchar(255) not null);
years < 1901 don't work
alter table movies drop column year;
alter table movies add column (year smallint);
want an index on imdb_title:
drop index movie_titles on movies;
create index movie_titles on movies (imdb_title, title);
want genres:
create table genres (
id int not null auto_increment primary key,
movie_id int not null,
genre varchar(12) not null
);
want countries:
create table countries (
id int not null auto_increment primary key,
movie_id int not null,
country varchar(70) not null
);
much better and faster search field creation:
insert into movies_search(movie_id, search_field)
select
m.id, concat(m.imdb_title, " ", ifnull(dirnames.names, ""), " ", ifnull(alttitles.titles, "")) as search_field
from movies m
left outer join alttitles on m.id = alttitles.movie_id
left outer join dirnames on m.id = dirnames.movie_id;