$this->addSql("CREATE TABLE users (id INT AUTO_INCREMENT NOT NULL, accepted_by_id INT DEFAULT NULL, username VARCHAR(50) NOT NULL, password VARCHAR(50) NOT NULL, display_name VARCHAR(50) NOT NULL, email VARCHAR(100) NOT NULL, registered_at DATETIME NOT NULL, last_login_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_1483A5E9F85E0677 (username), UNIQUE INDEX UNIQ_1483A5E9D5499347 (display_name), UNIQUE INDEX UNIQ_1483A5E9E7927C74 (email), INDEX IDX_1483A5E920F699D9 (accepted_by_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("CREATE TABLE roles (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(50) NOT NULL, `default` TINYINT(1) NOT NULL, admin TINYINT(1) NOT NULL, superAdmin TINYINT(1) NOT NULL, description VARCHAR(150) DEFAULT NULL, short_description VARCHAR(50) NOT NULL, UNIQUE INDEX UNIQ_B63E2EC75E237E06 (name), UNIQUE INDEX UNIQ_B63E2EC79BE5A5B1 (short_description), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("CREATE TABLE user_role (user_id INT NOT NULL, role_id INT NOT NULL, INDEX IDX_2DE8C6A3A76ED395 (user_id), INDEX IDX_2DE8C6A3D60322AC (role_id), PRIMARY KEY(user_id, role_id)) ENGINE = InnoDB");
$this->addSql("CREATE TABLE news (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, title VARCHAR(100) NOT NULL, text LONGTEXT NOT NULL, created_at DATETIME NOT NULL, public TINYINT(1) NOT NULL, INDEX IDX_1DD39950B03A8386 (created_by_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("CREATE TABLE documents (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, title VARCHAR(150) NOT NULL, slug VARCHAR(150) NOT NULL, created_at DATETIME NOT NULL, content LONGTEXT NOT NULL, updatedAt DATETIME DEFAULT NULL, updateReason LONGTEXT DEFAULT NULL, updatedBy_id INT DEFAULT NULL, UNIQUE INDEX UNIQ_A2B072882B36786B (title), UNIQUE INDEX UNIQ_A2B07288989D9B62 (slug), INDEX IDX_A2B07288B03A8386 (created_by_id), INDEX IDX_A2B0728865FF1AEC (updatedBy_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("CREATE TABLE groups (id INT AUTO_INCREMENT NOT NULL, leader_id INT DEFAULT NULL, created_by_id INT DEFAULT NULL, name VARCHAR(50) NOT NULL, slug VARCHAR(50) NOT NULL, created_at DATETIME NOT NULL, description LONGTEXT DEFAULT NULL, open TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_F06D39705E237E06 (name), UNIQUE INDEX UNIQ_F06D3970989D9B62 (slug), INDEX IDX_F06D397073154ED4 (leader_id), INDEX IDX_F06D3970B03A8386 (created_by_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("CREATE TABLE user_group_memberships (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, group_id INT DEFAULT NULL, membership_accepted_by_id INT DEFAULT NULL, membership_requested_at DATETIME NOT NULL, membership_accepted_at DATETIME DEFAULT NULL, INDEX IDX_5BFDE39CA76ED395 (user_id), INDEX IDX_5BFDE39CFE54D947 (group_id), INDEX IDX_5BFDE39C768D2C12 (membership_accepted_by_id), UNIQUE INDEX UNIQ_5BFDE39CA76ED395FE54D947 (user_id, group_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("CREATE TABLE group_document (group_id INT NOT NULL, document_id INT NOT NULL, INDEX IDX_D159C609FE54D947 (group_id), INDEX IDX_D159C609C33F7837 (document_id), PRIMARY KEY(group_id, document_id)) ENGINE = InnoDB");
$this->addSql("CREATE TABLE articles (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, created_at DATETIME NOT NULL, title VARCHAR(100) NOT NULL, slug VARCHAR(100) NOT NULL, text LONGTEXT NOT NULL, main_page TINYINT(1) NOT NULL, public TINYINT(1) NOT NULL, source VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_BFDD31682B36786B (title), UNIQUE INDEX UNIQ_BFDD3168989D9B62 (slug), INDEX IDX_BFDD3168B03A8386 (created_by_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("CREATE TABLE forum_topic_groups (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, createdAt DATETIME NOT NULL, slug VARCHAR(100) NOT NULL, title VARCHAR(100) NOT NULL, UNIQUE INDEX UNIQ_6BB4FCEF989D9B62 (slug), UNIQUE INDEX UNIQ_6BB4FCEF2B36786B (title), INDEX IDX_6BB4FCEFB03A8386 (created_by_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("CREATE TABLE forum_topics (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, topic_group_id INT NOT NULL, last_post_id INT DEFAULT NULL, created_at DATETIME NOT NULL, slug VARCHAR(100) NOT NULL, title VARCHAR(100) NOT NULL, INDEX IDX_895975E8B03A8386 (created_by_id), INDEX IDX_895975E88655441 (topic_group_id), UNIQUE INDEX UNIQ_895975E82D053F64 (last_post_id), UNIQUE INDEX UNIQ_895975E886554412B36786B (topic_group_id, title), UNIQUE INDEX UNIQ_895975E88655441989D9B62 (topic_group_id, slug), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("CREATE TABLE forum_posts (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, topic_id INT DEFAULT NULL, created_at DATETIME NOT NULL, text LONGTEXT NOT NULL, INDEX IDX_90291C2DB03A8386 (created_by_id), INDEX IDX_90291C2D1F55203D (topic_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("CREATE TABLE events (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, group_id INT DEFAULT NULL, start_date DATE NOT NULL, end_date DATE DEFAULT NULL, title VARCHAR(150) NOT NULL, slug VARCHAR(150) NOT NULL, description LONGTEXT NOT NULL, cancelled TINYINT(1) NOT NULL, start_time TIME NOT NULL, end_time TIME DEFAULT NULL, INDEX IDX_5387574AB03A8386 (created_by_id), INDEX IDX_5387574AFE54D947 (group_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("CREATE TABLE event_attendees (event_id INT NOT NULL, user_id INT NOT NULL, INDEX IDX_4E5C551871F7E88B (event_id), INDEX IDX_4E5C5518A76ED395 (user_id), PRIMARY KEY(event_id, user_id)) ENGINE = InnoDB");