Channel-Poll-Bot/schema.sql
Ceda EI 1a4db8d2c5 Change schema. Change functions to match new schema.
add_message_id for the new table. get_callback_id now gets id from
message_id table. Removed the null case from add_vote. Creating post no
longer adds an entry to poll table. It instead adds an entry to
message_ids table via add_message_id function
2019-01-07 00:19:44 +05:30

4 lines
246 B
SQL

CREATE TABLE IF NOT EXISTS poll(callback int NOT NULL, user_id int, name varchar, UNIQUE(callback, user_id));
CREATE TABLE IF NOT EXISTS message_ids(callback int PRIMARY KEY, message_id int NOT NULL UNIQUE);
INSERT INTO message_ids values(0, 0);