Added default settings to DB
This commit is contained in:
parent
042acb6b1a
commit
c451be78df
1 changed files with 18 additions and 18 deletions
36
web.py
36
web.py
|
@ -24,24 +24,24 @@ db = mysql.connector.connect(user=cfg['dbuser'], password=cfg['dbpass'], databas
|
||||||
c = db.cursor()
|
c = db.cursor()
|
||||||
dc = db.cursor(dictionary=True)
|
dc = db.cursor(dictionary=True)
|
||||||
# MariaDB [curiousgreg]> DESCRIBE data;
|
# MariaDB [curiousgreg]> DESCRIBE data;
|
||||||
# +---------------------+--------------+------+-----+------------------------------------------------+-------+
|
# +---------------------+---------------+------+-----+------------------------------------------------+-------+
|
||||||
# | Field | Type | Null | Key | Default | Extra |
|
# | Field | Type | Null | Key | Default | Extra |
|
||||||
# +---------------------+--------------+------+-----+------------------------------------------------+-------+
|
# +---------------------+---------------+------+-----+------------------------------------------------+-------+
|
||||||
# | username | varchar(64) | NO | PRI | NULL | |
|
# | username | varchar(64) | NO | PRI | NULL | |
|
||||||
# | instance | varchar(128) | NO | PRI | NULL | |
|
# | instance | varchar(128) | NO | PRI | NULL | |
|
||||||
# | password | tinytext | NO | | NULL | |
|
# | password | tinytext | NO | | NULL | |
|
||||||
# | avi | text | NO | | NULL | |
|
# | avi | text | NO | | NULL | |
|
||||||
# | secret | tinytext | NO | | NULL | |
|
# | secret | tinytext | NO | | NULL | |
|
||||||
# | client_id | varchar(128) | NO | | NULL | |
|
# | client_id | varchar(128) | NO | | NULL | |
|
||||||
# | client_secret | tinytext | NO | | NULL | |
|
# | client_secret | tinytext | NO | | NULL | |
|
||||||
# | cc | tinytext | YES | | NULL | |
|
# | cc | tinytext | YES | | NULL | |
|
||||||
# | ccavi | varchar(128) | YES | | https://lynnesbian.space/res/ceres/cc-smol.png | |
|
# | ccavi | varchar(128) | YES | | https://lynnesbian.space/res/ceres/cc-smol.png | |
|
||||||
# | latest_post | tinytext | YES | | NULL | |
|
# | latest_post | tinytext | YES | | NULL | |
|
||||||
# | last_check | tinytext | YES | | NULL | |
|
# | last_check | tinytext | YES | | NULL | |
|
||||||
# | time_between_checks | int(11) | YES | | NULL | |
|
# | time_between_checks | int(11) | YES | | NULL | |
|
||||||
# | settings | longtext | YES | | NULL | |
|
# | settings | varchar(4096) | YES | | {'cw': False} | |
|
||||||
# +---------------------+--------------+------+-----+------------------------------------------------+-------+
|
# +---------------------+---------------+------+-----+------------------------------------------------+-------+
|
||||||
c.execute("CREATE TABLE IF NOT EXISTS `data` (username VARCHAR(64) NOT NULL, instance VARCHAR(128) NOT NULL, password TINYTEXT NOT NULL, avi TEXT NOT NULL, secret TINYTEXT NOT NULL, client_id VARCHAR(128) NOT NULL, client_secret TINYTEXT NOT NULL, cc TINYTEXT, ccavi VARCHAR(128) DEFAULT 'https://lynnesbian.space/res/ceres/cc-smol.png', latest_post TINYTEXT, last_check TINYTEXT, time_between_checks INT, settings LONGTEXT, PRIMARY KEY(username, instance))")
|
c.execute("CREATE TABLE IF NOT EXISTS `data` (username VARCHAR(64) NOT NULL, instance VARCHAR(128) NOT NULL, password TINYTEXT NOT NULL, avi TEXT NOT NULL, secret TINYTEXT NOT NULL, client_id VARCHAR(128) NOT NULL, client_secret TINYTEXT NOT NULL, cc TINYTEXT, ccavi VARCHAR(128) DEFAULT 'https://lynnesbian.space/res/ceres/cc-smol.png', latest_post TINYTEXT, last_check TINYTEXT, time_between_checks INT, settings VARCHAR(4096) DEFAULT \"{}\", PRIMARY KEY(username, instance))".format(settings))
|
||||||
|
|
||||||
app = Flask(cfg['name'])
|
app = Flask(cfg['name'])
|
||||||
app.secret_key = cfg['flask_key']
|
app.secret_key = cfg['flask_key']
|
||||||
|
|
Loading…
Reference in a new issue