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

Move models to separate files #393

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2dba8bc
Move users model to separate file
ZIMkaRU Jul 12, 2024
7b193ef
Move subAccounts model to separate file
ZIMkaRU Jul 15, 2024
2efc033
Move ledgers model to separate file
ZIMkaRU Jul 15, 2024
2628ccc
Move trades model to separate file
ZIMkaRU Jul 15, 2024
4c6a607
Move fundingTrades model to separate file
ZIMkaRU Jul 15, 2024
b22b265
Move publicTrades model to separate file
ZIMkaRU Jul 15, 2024
bfa4023
Move orders model to separate file
ZIMkaRU Jul 15, 2024
a0a6f75
Move movements model to separate file
ZIMkaRU Jul 15, 2024
fc91e4a
Move fundingOfferHistory model to separate file
ZIMkaRU Jul 15, 2024
709b65c
Move fundingLoanHistory model to separate file
ZIMkaRU Jul 15, 2024
9e66c55
Move fundingCreditHistory model to separate file
ZIMkaRU Jul 15, 2024
a64f2ed
Move positionsHistory model to separate file
ZIMkaRU Jul 15, 2024
41d6619
Move positionsSnapshot model to separate file
ZIMkaRU Jul 15, 2024
8ba57b0
Move logins model to separate file
ZIMkaRU Jul 15, 2024
3260dca
Move changeLogs model to separate file
ZIMkaRU Jul 15, 2024
3d1a946
Move payInvoiceList model to separate file
ZIMkaRU Jul 15, 2024
ad55ec8
Move tickersHistory model to separate file
ZIMkaRU Jul 16, 2024
20ae8c0
Move statusMessages model to separate file
ZIMkaRU Jul 16, 2024
bb369e5
Move publicCollsConf model to separate file
ZIMkaRU Jul 16, 2024
cf22903
Move symbol models to separate files
ZIMkaRU Jul 16, 2024
f64ba5c
Move candles model to separate file
ZIMkaRU Jul 16, 2024
79ddf93
Move sync service models to separate files
ZIMkaRU Jul 16, 2024
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
824 changes: 0 additions & 824 deletions workers/loc.api/sync/schema/models.js

This file was deleted.

27 changes: 27 additions & 0 deletions workers/loc.api/sync/schema/models/candles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use strict'

const {
INDEX_FIELD_NAME,
UNIQUE_INDEX_FIELD_NAME,
ID_PRIMARY_KEY
} = require('../const')

module.exports = {
_id: ID_PRIMARY_KEY,
mts: 'BIGINT',
open: 'DECIMAL(22,12)',
close: 'DECIMAL(22,12)',
high: 'DECIMAL(22,12)',
low: 'DECIMAL(22,12)',
volume: 'DECIMAL(22,12)',
_symbol: 'VARCHAR(255)',
_timeframe: 'VARCHAR(255)',

[UNIQUE_INDEX_FIELD_NAME]: ['_symbol', '_timeframe', 'mts'],
[INDEX_FIELD_NAME]: [
['_timeframe', '_symbol', 'mts'],
['_timeframe', 'mts'],
['_symbol', 'mts'],
['close', 'mts']
]
}
33 changes: 33 additions & 0 deletions workers/loc.api/sync/schema/models/change-logs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
'use strict'

const {
CONSTR_FIELD_NAME,
INDEX_FIELD_NAME,
UNIQUE_INDEX_FIELD_NAME,
ID_PRIMARY_KEY
} = require('../const')
const {
USER_ID_CONSTRAINT,
SUB_USER_ID_CONSTRAINT
} = require('../common.constraints')

module.exports = {
_id: ID_PRIMARY_KEY,
mtsCreate: 'BIGINT',
log: 'VARCHAR(255)',
ip: 'VARCHAR(255)',
userAgent: 'TEXT',
subUserId: 'INT',
user_id: 'INT NOT NULL',

[UNIQUE_INDEX_FIELD_NAME]: ['mtsCreate', 'log', 'user_id'],
[INDEX_FIELD_NAME]: [
['user_id', 'mtsCreate'],
['user_id', 'subUserId', 'mtsCreate',
'WHERE subUserId IS NOT NULL']
],
[CONSTR_FIELD_NAME]: [
USER_ID_CONSTRAINT,
SUB_USER_ID_CONSTRAINT
]
}
18 changes: 18 additions & 0 deletions workers/loc.api/sync/schema/models/currencies.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict'

const {
UNIQUE_INDEX_FIELD_NAME,
ID_PRIMARY_KEY
} = require('../const')

module.exports = {
_id: ID_PRIMARY_KEY,
id: 'VARCHAR(255)',
name: 'VARCHAR(255)',
pool: 'VARCHAR(255)',
explorer: 'TEXT',
symbol: 'VARCHAR(255)',
walletFx: 'TEXT',

[UNIQUE_INDEX_FIELD_NAME]: ['id']
}
49 changes: 49 additions & 0 deletions workers/loc.api/sync/schema/models/funding-credit-history.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
'use strict'

const {
CONSTR_FIELD_NAME,
INDEX_FIELD_NAME,
UNIQUE_INDEX_FIELD_NAME,
ID_PRIMARY_KEY
} = require('../const')
const {
USER_ID_CONSTRAINT,
SUB_USER_ID_CONSTRAINT
} = require('../common.constraints')

module.exports = {
_id: ID_PRIMARY_KEY,
id: 'BIGINT',
symbol: 'VARCHAR(255)',
side: 'INT',
mtsCreate: 'BIGINT',
mtsUpdate: 'BIGINT',
amount: 'DECIMAL(22,12)',
flags: 'TEXT',
status: 'TEXT',
rate: 'VARCHAR(255)',
period: 'INT',
mtsOpening: 'BIGINT',
mtsLastPayout: 'BIGINT',
notify: 'INT',
hidden: 'INT',
renew: 'INT',
rateReal: 'INT',
noClose: 'INT',
positionPair: 'VARCHAR(255)',
subUserId: 'INT',
user_id: 'INT NOT NULL',

[UNIQUE_INDEX_FIELD_NAME]: ['id', 'user_id'],
[INDEX_FIELD_NAME]: [
['user_id', 'symbol', 'mtsUpdate'],
['user_id', 'status', 'mtsUpdate'],
['user_id', 'mtsUpdate'],
['user_id', 'subUserId', 'mtsUpdate',
'WHERE subUserId IS NOT NULL']
],
[CONSTR_FIELD_NAME]: [
USER_ID_CONSTRAINT,
SUB_USER_ID_CONSTRAINT
]
}
48 changes: 48 additions & 0 deletions workers/loc.api/sync/schema/models/funding-loan-history.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
'use strict'

const {
CONSTR_FIELD_NAME,
INDEX_FIELD_NAME,
UNIQUE_INDEX_FIELD_NAME,
ID_PRIMARY_KEY
} = require('../const')
const {
USER_ID_CONSTRAINT,
SUB_USER_ID_CONSTRAINT
} = require('../common.constraints')

module.exports = {
_id: ID_PRIMARY_KEY,
id: 'BIGINT',
symbol: 'VARCHAR(255)',
side: 'INT',
mtsCreate: 'BIGINT',
mtsUpdate: 'BIGINT',
amount: 'DECIMAL(22,12)',
flags: 'TEXT',
status: 'TEXT',
rate: 'VARCHAR(255)',
period: 'INT',
mtsOpening: 'BIGINT',
mtsLastPayout: 'BIGINT',
notify: 'INT',
hidden: 'INT',
renew: 'INT',
rateReal: 'INT',
noClose: 'INT',
subUserId: 'INT',
user_id: 'INT NOT NULL',

[UNIQUE_INDEX_FIELD_NAME]: ['id', 'user_id'],
[INDEX_FIELD_NAME]: [
['user_id', 'symbol', 'mtsUpdate'],
['user_id', 'status', 'mtsUpdate'],
['user_id', 'mtsUpdate'],
['user_id', 'subUserId', 'mtsUpdate',
'WHERE subUserId IS NOT NULL']
],
[CONSTR_FIELD_NAME]: [
USER_ID_CONSTRAINT,
SUB_USER_ID_CONSTRAINT
]
}
47 changes: 47 additions & 0 deletions workers/loc.api/sync/schema/models/funding-offer-history.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
'use strict'

const {
CONSTR_FIELD_NAME,
INDEX_FIELD_NAME,
UNIQUE_INDEX_FIELD_NAME,
ID_PRIMARY_KEY
} = require('../const')
const {
USER_ID_CONSTRAINT,
SUB_USER_ID_CONSTRAINT
} = require('../common.constraints')

module.exports = {
_id: ID_PRIMARY_KEY,
id: 'BIGINT',
symbol: 'VARCHAR(255)',
mtsCreate: 'BIGINT',
mtsUpdate: 'BIGINT',
amount: 'DECIMAL(22,12)',
amountOrig: 'DECIMAL(22,12)',
type: 'VARCHAR(255)',
flags: 'TEXT',
status: 'TEXT',
rate: 'VARCHAR(255)',
period: 'INT',
notify: 'INT',
hidden: 'INT',
renew: 'INT',
rateReal: 'INT',
amountExecuted: 'DECIMAL(22,12)',
subUserId: 'INT',
user_id: 'INT NOT NULL',

[UNIQUE_INDEX_FIELD_NAME]: ['id', 'user_id'],
[INDEX_FIELD_NAME]: [
['user_id', 'symbol', 'mtsUpdate'],
['user_id', 'status', 'mtsUpdate'],
['user_id', 'mtsUpdate'],
['user_id', 'subUserId', 'mtsUpdate',
'WHERE subUserId IS NOT NULL']
],
[CONSTR_FIELD_NAME]: [
USER_ID_CONSTRAINT,
SUB_USER_ID_CONSTRAINT
]
}
38 changes: 38 additions & 0 deletions workers/loc.api/sync/schema/models/funding-trades.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
'use strict'

const {
CONSTR_FIELD_NAME,
INDEX_FIELD_NAME,
UNIQUE_INDEX_FIELD_NAME,
ID_PRIMARY_KEY
} = require('../const')
const {
USER_ID_CONSTRAINT,
SUB_USER_ID_CONSTRAINT
} = require('../common.constraints')

module.exports = {
_id: ID_PRIMARY_KEY,
id: 'BIGINT',
symbol: 'VARCHAR(255)',
mtsCreate: 'BIGINT',
offerID: 'BIGINT',
amount: 'DECIMAL(22,12)',
rate: 'DECIMAL(22,12)',
period: 'BIGINT',
maker: 'INT',
subUserId: 'INT',
user_id: 'INT NOT NULL',

[UNIQUE_INDEX_FIELD_NAME]: ['id', 'user_id'],
[INDEX_FIELD_NAME]: [
['user_id', 'symbol', 'mtsCreate'],
['user_id', 'mtsCreate'],
['user_id', 'subUserId', 'mtsCreate',
'WHERE subUserId IS NOT NULL']
],
[CONSTR_FIELD_NAME]: [
USER_ID_CONSTRAINT,
SUB_USER_ID_CONSTRAINT
]
}
13 changes: 13 additions & 0 deletions workers/loc.api/sync/schema/models/futures.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict'

const {
UNIQUE_INDEX_FIELD_NAME,
ID_PRIMARY_KEY
} = require('../const')

module.exports = {
_id: ID_PRIMARY_KEY,
pairs: 'VARCHAR(255)',

[UNIQUE_INDEX_FIELD_NAME]: ['pairs']
}
13 changes: 13 additions & 0 deletions workers/loc.api/sync/schema/models/inactive-currencies.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict'

const {
UNIQUE_INDEX_FIELD_NAME,
ID_PRIMARY_KEY
} = require('../const')

module.exports = {
_id: ID_PRIMARY_KEY,
pairs: 'VARCHAR(255)',

[UNIQUE_INDEX_FIELD_NAME]: ['pairs']
}
13 changes: 13 additions & 0 deletions workers/loc.api/sync/schema/models/inactive-symbols.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict'

const {
UNIQUE_INDEX_FIELD_NAME,
ID_PRIMARY_KEY
} = require('../const')

module.exports = {
_id: ID_PRIMARY_KEY,
pairs: 'VARCHAR(255)',

[UNIQUE_INDEX_FIELD_NAME]: ['pairs']
}
Loading