Skip to content

Commit 1f47d33

Browse files
committed
fix: Update Challonge Integration to include Steam IDs (#302)
* Include new custom field responses from challonge. A user can create a mutlitude of text inputs on Challonge to enter in Steam IDs and it will now iterate through the object and insert the Steam IDs into the team auth arrays without a nickname. * Update challonge functions and move them over to utils. Now insert any steam IDs that exist in hte custom input. * Change typing of returned challonge data. * Update database to ensure our default name is just blank and not null.
1 parent af6af0c commit 1f47d33

File tree

7 files changed

+152
-9829
lines changed

7 files changed

+152
-9829
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
'use strict';
2+
3+
var dbm;
4+
var type;
5+
var seed;
6+
7+
/**
8+
* We receive the dbmigrate dependency from dbmigrate initially.
9+
* This enables us to not have to rely on NODE_PATH.
10+
*/
11+
exports.setup = function(options, seedLink) {
12+
dbm = options.dbmigrate;
13+
type = dbm.dataType;
14+
seed = seedLink;
15+
};
16+
17+
exports.up = function(db) {
18+
return db
19+
.runSql("ALTER TABLE team_auth_names ALTER COLUMN name SET DEFAULT ''")
20+
};
21+
22+
exports.down = function(db) {
23+
return db
24+
.runSql("ALTER TABLE team_auth_names MODIFY COLUMN name varchar(40) NULL")
25+
.then(() => {
26+
return db.runSql(
27+
"ALTER TABLE team_auth_names ALTER COLUMN name SET DEFAULT NULL"
28+
);
29+
})
30+
.then(() => {
31+
return db.runSql(
32+
"ALTER TABLE team_auth_names MODIFY COLUMN name varchar(40) NOT NULL"
33+
);
34+
});
35+
};
36+
37+
exports._meta = {
38+
"version": 28
39+
};
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
'use strict';
2+
3+
var dbm;
4+
var type;
5+
var seed;
6+
7+
/**
8+
* We receive the dbmigrate dependency from dbmigrate initially.
9+
* This enables us to not have to rely on NODE_PATH.
10+
*/
11+
exports.setup = function(options, seedLink) {
12+
dbm = options.dbmigrate;
13+
type = dbm.dataType;
14+
seed = seedLink;
15+
};
16+
17+
exports.up = function(db) {
18+
return db
19+
.runSql("ALTER TABLE team_auth_names ALTER COLUMN name SET DEFAULT ''")
20+
};
21+
22+
exports.down = function(db) {
23+
return db
24+
.runSql("ALTER TABLE team_auth_names MODIFY COLUMN name varchar(40) NULL")
25+
.then(() => {
26+
return db.runSql(
27+
"ALTER TABLE team_auth_names ALTER COLUMN name SET DEFAULT NULL"
28+
);
29+
})
30+
.then(() => {
31+
return db.runSql(
32+
"ALTER TABLE team_auth_names MODIFY COLUMN name varchar(40) NOT NULL"
33+
);
34+
});
35+
};
36+
37+
exports._meta = {
38+
"version": 28
39+
};
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
'use strict';
2+
3+
var dbm;
4+
var type;
5+
var seed;
6+
7+
/**
8+
* We receive the dbmigrate dependency from dbmigrate initially.
9+
* This enables us to not have to rely on NODE_PATH.
10+
*/
11+
exports.setup = function(options, seedLink) {
12+
dbm = options.dbmigrate;
13+
type = dbm.dataType;
14+
seed = seedLink;
15+
};
16+
17+
exports.up = function(db) {
18+
return db
19+
.runSql("ALTER TABLE team_auth_names ALTER COLUMN name SET DEFAULT ''")
20+
};
21+
22+
exports.down = function(db) {
23+
return db
24+
.runSql("ALTER TABLE team_auth_names MODIFY COLUMN name varchar(40) NULL")
25+
.then(() => {
26+
return db.runSql(
27+
"ALTER TABLE team_auth_names ALTER COLUMN name SET DEFAULT NULL"
28+
);
29+
})
30+
.then(() => {
31+
return db.runSql(
32+
"ALTER TABLE team_auth_names MODIFY COLUMN name varchar(40) NOT NULL"
33+
);
34+
});
35+
};
36+
37+
exports._meta = {
38+
"version": 28
39+
};

0 commit comments

Comments
 (0)