X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/4f2f1126a7a13ee3a6348e6033620ea6eb2b0d8e..7b649ccad8804580632c255b9f451482fdbbe32d:/db/create.sql diff --git a/db/create.sql b/db/create.sql index a5a2e0a..298b99a 100644 --- a/db/create.sql +++ b/db/create.sql @@ -27,9 +27,20 @@ create table candidates ( election_id int NOT NULL, name varchar(100) NOT NULL, description text NULL, - picture_filename varchar(200), - picture_data blob, - picture_type varchar(100), + primary key (id) +); + +# CREATE pictures TABLE +##################################### + +drop table if exists pictures; +create table pictures ( + id int NOT NULL auto_increment, + filename varchar(200), + data blob, + filetype varchar(100), + candidate_id int NULL, + constraint fk_candidate_picture foreign key (candidate_id) references candidates(id), primary key (id) );