X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/6fdb49ee0dfc76980bcefb18968d1e1c55c8149c..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) );