Skip to content

2. SQL Setup

Noah Steinberg edited this page Oct 25, 2018 · 7 revisions

SQL Database Requirements

In order to connect to Production/Testing on HostGator you need to whitelist your IP, and contact the CTO for the credentials. Otherwise you must install a local instance of mySQL. In both cases, ensure you have the following environment variables set:

  • SQL_HOST : host to connect to (likely localhost for dev)
  • SQL_PORT : port to connect to on the host
  • SQL_USER : user to connect as
  • SQL_PASS : password to authenticate with
  • SQL_DATABASE : database to connect to

Tables

The following is the required schema for the bot. Please notify the CTO if there is any discrepancy between this and what you see.

bot_permissions

+---------------+-------------+------+-----+---------+-------+  
| Field         | Type        | Null | Key | Default | Extra |  
+---------------+-------------+------+-----+---------+-------+  
| id            | varchar(50) | NO   | PRI |         |       |   
| username      | varchar(32) | NO   |     | NULL    |       |  
| discriminator | varchar(4)  | YES  |     | NULL    |       |  
| permissions   | int(11)     | YES  |     | NULL    |       |  
| notes         | text        | YES  |     | NULL    |       |  
+---------------+-------------+------+-----+---------+-------+  

special_channels

+-------+--------------+------+-----+---------+-------+  
| Field | Type         | Null | Key | Default | Extra |  
+-------+--------------+------+-----+---------+-------+  
| role  | varchar(255) | NO   | PRI | NULL    |       |  
| id    | varchar(50)  | YES  |     | NULL    |       |  
| name  | varchar(255) | YES  |     | NULL    |       |  
+-------+--------------+------+-----+---------+-------+  

warnings

+--------+--------------+------+-----+---------+-------+  
| Field  | Type         | Null | Key | Default | Extra |  
+--------+--------------+------+-----+---------+-------+  
| id     | varchar(255) | NO   | PRI | NULL    |       |  
| userid | varchar(255) | NO   |     | NULL    |       |  
| reason | varchar(255) | NO   |     | NULL    |       |  
+--------+--------------+------+-----+---------+-------+  

Clone this wiki locally