File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 5
5
6
6
import peewee
7
7
import pytz
8
+ from playhouse .migrate import SqliteMigrator , migrate
8
9
9
10
FILE_INFO_V2 = ".data/tz_v2.json"
10
11
FILE_SQLITE_DB = ".data/tz_v3.db"
11
12
12
13
db = peewee .SqliteDatabase (FILE_SQLITE_DB )
14
+ db_migrator = SqliteMigrator (db )
13
15
14
16
15
17
COMMON_TIMEZONES = [
@@ -66,7 +68,6 @@ class DBGuild(DBBaseModel):
66
68
discord_id = peewee .CharField (unique = True )
67
69
channel_id = peewee .CharField (default = "" )
68
70
message_id = peewee .CharField (default = "" )
69
- message_id_others = ArrayField (default = [])
70
71
71
72
72
73
class DBMember (DBBaseModel ):
@@ -79,6 +80,10 @@ class WorldClockData:
79
80
def __init__ (self ):
80
81
_ = db .connect ()
81
82
db .create_tables ([DBGuild , DBMember ])
83
+ message_id_others = ArrayField (default = [])
84
+ migrate (
85
+ db_migrator .add_column (DBGuild ._meta .table_name , "message_id_others" , message_id_others )
86
+ )
82
87
# START Transform old format to new
83
88
if os .path .isfile (FILE_INFO_V2 ):
84
89
import json
You can’t perform that action at this time.
0 commit comments