CREATE TABLE "users" ( "id" int PRIMARY KEY, "name" varchar(255), "token" varchar(255) ); CREATE TABLE "commands" ( "id" int PRIMARY KEY, "command" varchar(255) ); CREATE TABLE "parsers" ( "id" int PRIMARY KEY, "event_type_id" int CONSTRAINT event_types_id REFERENCES event_types(id), "name" varchar(255) ); CREATE TABLE "event_types" ( "id" int PRIMARY KEY, "name" varchar(255) ); CREATE TABLE "questions" ( "id" int PRIMARY KEY, "question" varchar(255) ); CREATE TABLE "answers" ( "id" int PRIMARY KEY, "question_id" int CONSTRAINT questions_id REFERENCES questions(id), "answer" varchar(255) ); CREATE TABLE "user_infomation" ( "id" int, "user_id" int CONSTRAINT users_id REFERENCES users(id), "question_id" int CONSTRAINT questions_id REFERENCES questions(id), "answer_id" int CONSTRAINT answers_id REFERENCES answers(id) ); CREATE TABLE "events" ( "id" int, "type_id" int CONSTRAINT event_types_id REFERENCES event_types(id), "name" varchar(255), "datetime" datetime, "image" varchar(255), "address" varchar(255), "description" varchar(255) ); CREATE TABLE "cp_connection" ( "id" int, "command_id" varchar(255) CONSTRAINT commands_id REFERENCES commands(id), "parse_id" varchar(255) CONSTRAINT parsers_id REFERENCES parsers(id) );