Added default settings to DB
This commit is contained in:
parent
042acb6b1a
commit
c451be78df
1 changed files with 18 additions and 18 deletions
10
web.py
10
web.py
|
@ -24,9 +24,9 @@ db = mysql.connector.connect(user=cfg['dbuser'], password=cfg['dbpass'], databas
|
|||
c = db.cursor()
|
||||
dc = db.cursor(dictionary=True)
|
||||
# MariaDB [curiousgreg]> DESCRIBE data;
|
||||
# +---------------------+--------------+------+-----+------------------------------------------------+-------+
|
||||
# +---------------------+---------------+------+-----+------------------------------------------------+-------+
|
||||
# | Field | Type | Null | Key | Default | Extra |
|
||||
# +---------------------+--------------+------+-----+------------------------------------------------+-------+
|
||||
# +---------------------+---------------+------+-----+------------------------------------------------+-------+
|
||||
# | username | varchar(64) | NO | PRI | NULL | |
|
||||
# | instance | varchar(128) | NO | PRI | NULL | |
|
||||
# | password | tinytext | NO | | NULL | |
|
||||
|
@ -39,9 +39,9 @@ dc = db.cursor(dictionary=True)
|
|||
# | latest_post | tinytext | YES | | NULL | |
|
||||
# | last_check | tinytext | YES | | NULL | |
|
||||
# | time_between_checks | int(11) | YES | | NULL | |
|
||||
# | settings | longtext | YES | | NULL | |
|
||||
# +---------------------+--------------+------+-----+------------------------------------------------+-------+
|
||||
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))")
|
||||
# | 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 VARCHAR(4096) DEFAULT \"{}\", PRIMARY KEY(username, instance))".format(settings))
|
||||
|
||||
app = Flask(cfg['name'])
|
||||
app.secret_key = cfg['flask_key']
|
||||
|
|
Loading…
Reference in a new issue