-
Notifications
You must be signed in to change notification settings - Fork 629
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add plaudits to char_points and RoeSparkUpdatePacket
- Loading branch information
Showing
2 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import mariadb | ||
|
||
|
||
def migration_name(): | ||
return "Adding plaudits column to char_points table" | ||
|
||
|
||
def check_preconditions(cur): | ||
return | ||
|
||
|
||
def needs_to_run(cur): | ||
# Ensure waypoints column exists in char_unlocks | ||
cur.execute("SHOW COLUMNS FROM char_points LIKE 'plaudits'") | ||
if not cur.fetchone(): | ||
return True | ||
return False | ||
|
||
|
||
def migrate(cur, db): | ||
try: | ||
cur.execute( | ||
"ALTER TABLE char_points \ | ||
ADD COLUMN `plaudits` smallint(5) DEFAULT 0;" | ||
) | ||
db.commit() | ||
except mariadb.Error as err: | ||
print("Something went wrong: {}".format(err)) |