Eventra is a relatively mid-complex, web-based platform which helps mainly Cameroonians organize events. A person having an account can create an event, sell tickets, create polls for votes, manage funds to hire people for the event.
A view of the schema.
Events are the main thing the platform deals with
So, a user can be one, or several of these:
- Organizers: which organize events
- Prestataire: which propose services at events
- Participants: which participate in an event
create table users (
id bigserial primary key not null, -- redundant
username varchar(63) not null,
first_name varchar(63) not null,
last_name varchar(63) not null,
phone varchar(31), -- we will use 255 everywhere of course :D
email varchar(63),
birth_date date not null,
);Events are organized by one or more organizer, an event may have affiliated organizers, polls, prestataires and more.
The complexity comes on the events themselves, an event may have complex information with it, including:
Every event/subevent has it's own schedule associated to it directly
This is just a way to mark different meetings, other things taking place in the big event.
create table events (
id bigserial primary key not null,
event_name varchar(255) not null,
start_time datetime not null,
end_time datetime not null,
);
create table subevents (
id bigserial primary key not null,
event_id bigint references evens(id) on delete cascade,
subevent_name varchar(255) not null,
subevent_description text,
start_time datetime not null,
end_time datetime not null,
);Every organizer is associated with a specific event and an event can have one or more organizers.
create table organizers (
user_id bigint primary key references users(id) on delete cascade,
event bigint references events(id) on delete cascade,
role varchar(255) not null,
);A poll or vote can be associated with an event, basically there is a poll/vote, there are candidate results associated with it, and there are the votes themselves.
create table polls (
id bigserial primary key not null,
);
create table poll_candidates (
poll_id bigint references polls(id) not null,
candidate_id smallint not null,
-- data for description/caption/...
primary key (poll_id, candidate_id)
);
create table poll_vote (
poll_id bigint references polls(id) not null,
candidate_id smallint not null,
voter_id bigint references users(id) not null,
primary key (poll_id, candidate_id, voter_id);
);create table prestaterians (
id bigint primary key references users(id) not null,
tags text,
-- bio/profile/...
);
create table prestaterian_reviews (
prestaterian_id bigint references prestaterians(id) not null,
reviewer_id bigint references prestaterians(id) not null,
review_text varchar(511), -- or just text, depends
review_score smallint,
primary key (prestaterian_id, reviewer_id);
)