Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update master branch with v1.10 #444

Merged
merged 18 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion __tests__/wallet-get.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ describe('Wallet: Get wallets of an account', () => {
await walletService.createWallet(seed.wallet.id, `test${i}`);
}

const res = await walletService.getAllWallets(seed.wallet.id);
const res = await walletService.getAllWallets(
seed.wallet.id,
undefined,
undefined,
'created_at',
'desc',
);
expect(res.count).to.eq(11);
});

Expand Down
16 changes: 7 additions & 9 deletions database/migrations/20200917183542-CreateTableWallet.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@


let dbm;
let type;
let seed;

/**
* We receive the dbmigrate dependency from dbmigrate initially.
* This enables us to not have to rely on NODE_PATH.
*/
exports.setup = function(options, seedLink) {
* We receive the dbmigrate dependency from dbmigrate initially.
* This enables us to not have to rely on NODE_PATH.
*/
exports.setup = function (options, seedLink) {
dbm = options.dbmigrate;
type = dbm.dataType;
seed = seedLink;
};

exports.up = function(db) {
exports.up = function (db) {
return db.createTable('wallet', {
id: { type: 'uuid', primaryKey: true, notNull: true },
name: { type: 'string', notNull: true },
Expand All @@ -24,10 +22,10 @@ exports.up = function(db) {
});
};

exports.down = function(db) {
exports.down = function (db) {
return db.dropTable('wallet');
};

exports._meta = {
"version": 1
version: 1,
};
59 changes: 59 additions & 0 deletions database/migrations/20230314184543-add-batch-create-check.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
'use strict';

var dbm;
var type;
var seed;
var fs = require('fs');
var path = require('path');
var Promise;

/**
* We receive the dbmigrate dependency from dbmigrate initially.
* This enables us to not have to rely on NODE_PATH.
*/
exports.setup = function (options, seedLink) {
dbm = options.dbmigrate;
type = dbm.dataType;
seed = seedLink;
Promise = options.Promise;
};

exports.up = function (db) {
var filePath = path.join(
__dirname,
'sqls',
'20230314184543-add-batch-create-check-up.sql',
);
return new Promise(function (resolve, reject) {
fs.readFile(filePath, { encoding: 'utf-8' }, function (err, data) {
if (err) return reject(err);
console.log('received data: ' + data);

resolve(data);
});
}).then(function (data) {
return db.runSql(data);
});
};

exports.down = function (db) {
var filePath = path.join(
__dirname,
'sqls',
'20230314184543-add-batch-create-check-down.sql',
);
return new Promise(function (resolve, reject) {
fs.readFile(filePath, { encoding: 'utf-8' }, function (err, data) {
if (err) return reject(err);
console.log('received data: ' + data);

resolve(data);
});
}).then(function (data) {
return db.runSql(data);
});
};

exports._meta = {
version: 1,
};
59 changes: 59 additions & 0 deletions database/migrations/20230529135030-add-about.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
'use strict';

var dbm;
var type;
var seed;
var fs = require('fs');
var path = require('path');
var Promise;

/**
* We receive the dbmigrate dependency from dbmigrate initially.
* This enables us to not have to rely on NODE_PATH.
*/
exports.setup = function (options, seedLink) {
dbm = options.dbmigrate;
type = dbm.dataType;
seed = seedLink;
Promise = options.Promise;
};

exports.up = function (db) {
var filePath = path.join(
__dirname,
'sqls',
'20230529135030-add-about-up.sql',
);
return new Promise(function (resolve, reject) {
fs.readFile(filePath, { encoding: 'utf-8' }, function (err, data) {
if (err) return reject(err);
console.log('received data: ' + data);

resolve(data);
});
}).then(function (data) {
return db.runSql(data);
});
};

exports.down = function (db) {
var filePath = path.join(
__dirname,
'sqls',
'20230529135030-add-about-down.sql',
);
return new Promise(function (resolve, reject) {
fs.readFile(filePath, { encoding: 'utf-8' }, function (err, data) {
if (err) return reject(err);
console.log('received data: ' + data);

resolve(data);
});
}).then(function (data) {
return db.runSql(data);
});
};

exports._meta = {
version: 1,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE api_key DROP COLUMN batch_create_access;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE api_key ADD COLUMN batch_create_access BOOLEAN DEFAULT false;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE wallet DROP COLUMN about;
1 change: 1 addition & 0 deletions database/migrations/sqls/20230529135030-add-about-up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE wallet ADD COLUMN about varchar;
2 changes: 1 addition & 1 deletion deployment/base/treetracker-wallet-api-mapping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ spec:
prefix: /wallet/v2/
service: treetracker-wallet-api-v2
rewrite: /
timeout_ms: 0
timeout_ms: 10000
Loading
Loading