From b72cbe1af6507bbe44a82930e312ace82a909280 Mon Sep 17 00:00:00 2001 From: emkael Date: Sat, 29 May 2021 13:15:16 +0200 Subject: Bugfixes for accumulated butler --- butler/butler.py | 2 +- butler/config.json | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'butler') diff --git a/butler/butler.py b/butler/butler.py index 333f503..0405ddc 100644 --- a/butler/butler.py +++ b/butler/butler.py @@ -25,7 +25,7 @@ player_offset = 0 for s_db in config['source']: print('USE %s;' % (s_db)) - for table in ['matches', 'players', 'scores', 'teams', 'segments']: + for table in ['rounds', 'matches', 'players', 'scores', 'teams', 'segments']: print('DROP TABLE IF EXISTS _%s;' % (table)) print('CREATE TABLE _%s AS SELECT * FROM %s;' % (table, table)) if s_db in queries: diff --git a/butler/config.json b/butler/config.json index 4db9473..7c4cb04 100644 --- a/butler/config.json +++ b/butler/config.json @@ -41,16 +41,22 @@ "UPDATE _segments SET openN = 0, openS = 0, openW = 0, openE = 0, closeN = 0, closeS = 0, closeW = 0, closeE = 0, towel = 1 WHERE rnd < 6;" ], "dmp202021_2se": [ - "INSERT INTO _teams(id, bye) VALUES(15, 2),(16, 2);", - "INSERT INTO _matches(rnd, tabl, homet, visit, mtitle) SELECT rnd, 8, 15, 16, '--' FROM rounds WHERE rnd < 14;", + "UPDATE admin SET roundcnt = 15;", + "UPDATE _rounds SET rnd = rnd + 1 WHERE rnd > 5;", "UPDATE _matches SET rnd = rnd + 1 WHERE rnd > 5;", "UPDATE _segments SET rnd = rnd + 1 WHERE rnd > 5;", "UPDATE _scores SET rnd = rnd + 1 WHERE rnd > 5;", - "INSERT INTO _matches(rnd, tabl, homet, visit, mtitle) SELECT 6, id, id, id+8, '--' FROM teams WHERE id < 9;", + "INSERT INTO _rounds(rnd) VALUES(6);", + "INSERT INTO _matches(rnd, tabl, homet, visit, mtitle) SELECT 6, id, id, id+7, '--' FROM teams WHERE id < 8;", + "UPDATE _rounds SET rnd = rnd + 1 WHERE rnd > 10;", "UPDATE _matches SET rnd = rnd + 1 WHERE rnd > 10;", "UPDATE _segments SET rnd = rnd + 1 WHERE rnd > 10;", "UPDATE _scores SET rnd = rnd + 1 WHERE rnd > 10;", - "INSERT INTO _matches(rnd, tabl, homet, visit, mtitle) SELECT 11, id, id, id+8, '--' FROM teams WHERE id < 9;", + "INSERT INTO _rounds(rnd) VALUES(11);", + "INSERT INTO _matches(rnd, tabl, homet, visit, mtitle) SELECT 11, id, id, id+7, '--' FROM teams WHERE id < 8;", + "UPDATE admin SET teamcnt = 16;", + "INSERT INTO _teams(id, bye) VALUES(15, 2),(16, 2);", + "INSERT INTO _matches(rnd, tabl, homet, visit, mtitle) SELECT rnd, 8, 15, 16, '--' FROM rounds;", "INSERT INTO _segments(rnd, segment, tabl, homet, visit, towel) SELECT rnd, 1, 8, 15, 16, 1 FROM rounds;", "INSERT INTO _segments(rnd, segment, tabl, homet, visit, towel) SELECT rnd, 2, 8, 15, 16, 1 FROM rounds;" ] -- cgit v1.2.3