This repository has been archived by the owner on Oct 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'alpha' of github.com:withspectrum/spectrum into 3.1.6
- Loading branch information
Showing
16 changed files
with
224 additions
and
38 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
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 |
---|---|---|
|
@@ -8698,10 +8698,10 @@ serialize-javascript@^1.4.0: | |
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.5.0.tgz#1aa336162c88a890ddad5384baebc93a655161fe" | ||
integrity sha512-Ga8c8NjAAp46Br4+0oZ2WxJCwIzwP60Gq1YPgU+39PiTVxyed/iKE/zyZI6+UlVYH5Q4PaQdHhcegIFPZTUfoQ== | ||
|
||
serialize-javascript@^1.6.1: | ||
version "1.6.1" | ||
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.6.1.tgz#4d1f697ec49429a847ca6f442a2a755126c4d879" | ||
integrity sha512-A5MOagrPFga4YaKQSWHryl7AXvbQkEqpw4NNYMTNYUNV51bA8ABHgYFpqKx+YFFrw59xMV1qGH1R4AgoNIVgCw== | ||
serialize-javascript@^1.7.0: | ||
version "1.7.0" | ||
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.7.0.tgz#d6e0dfb2a3832a8c94468e6eb1db97e55a192a65" | ||
integrity sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA== | ||
|
||
[email protected]: | ||
version "1.13.2" | ||
|
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
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
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 |
---|---|---|
|
@@ -98,10 +98,10 @@ asynckit@^0.4.0: | |
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" | ||
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= | ||
|
||
aws-sdk@^2.426.0: | ||
version "2.426.0" | ||
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.426.0.tgz#cf17361c987daf518f945218f06135fbc1a3690d" | ||
integrity sha512-S4nmIhF/6iYeVEmKUWVG03zo1sw3zELoAPGqBKIZ3isrXbxkFXdP2cgIQxqi37zwWXSqaxt0xjeXVOMLzN6vSg== | ||
aws-sdk@^2.439.0: | ||
version "2.439.0" | ||
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.439.0.tgz#4a1d177507ef80b0b515c043938d814777645c40" | ||
integrity sha512-u7hCAMzpWbD6BqAwVHxr3cbm4YSbs0yv4crr7+bR/peM+UB6AbQLJFjFXx73dnIZq3R0Hr1bA7nh2Z9jkQLUdQ== | ||
dependencies: | ||
buffer "4.9.1" | ||
events "1.1.1" | ||
|
@@ -123,6 +123,14 @@ aws4@^1.8.0: | |
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" | ||
integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== | ||
|
||
babel-runtime@^6.18.0: | ||
version "6.26.0" | ||
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" | ||
integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= | ||
dependencies: | ||
core-js "^2.4.0" | ||
regenerator-runtime "^0.11.0" | ||
|
||
base64-js@^1.0.2: | ||
version "1.3.0" | ||
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" | ||
|
@@ -225,6 +233,11 @@ core-js@^1.0.0: | |
resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" | ||
integrity sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY= | ||
|
||
core-js@^2.4.0: | ||
version "2.6.5" | ||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895" | ||
integrity sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A== | ||
|
||
[email protected]: | ||
version "1.0.2" | ||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" | ||
|
@@ -972,6 +985,11 @@ redis-tag-cache@^1.2.1: | |
dependencies: | ||
ioredis "^4.0.0" | ||
|
||
regenerator-runtime@^0.11.0: | ||
version "0.11.1" | ||
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" | ||
integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== | ||
|
||
request@^2.81.0: | ||
version "2.88.0" | ||
resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" | ||
|
@@ -998,6 +1016,13 @@ request@^2.81.0: | |
tunnel-agent "^0.6.0" | ||
uuid "^3.3.2" | ||
|
||
rethinkdb-changefeed-reconnect@^0.3.2: | ||
version "0.3.2" | ||
resolved "https://registry.yarnpkg.com/rethinkdb-changefeed-reconnect/-/rethinkdb-changefeed-reconnect-0.3.2.tgz#2999f5313205ab35d9ac2d1b0533765ee3376923" | ||
integrity sha1-KZn1MTIFqzXZrC0bBTN2XuM3aSM= | ||
dependencies: | ||
babel-runtime "^6.18.0" | ||
|
||
rethinkdb-inspector@^0.3.3: | ||
version "0.3.3" | ||
resolved "https://registry.yarnpkg.com/rethinkdb-inspector/-/rethinkdb-inspector-0.3.3.tgz#f0d88c66d17e0234b5518ca51cd8c272cb787003" | ||
|
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,61 @@ | ||
const r = require('rethinkdbdash')(); | ||
const type = require('type-detect'); | ||
|
||
const REF_TABLE_MAP = { | ||
creators: 'users', | ||
authors: 'users', | ||
senders: 'users', | ||
communitys: 'communities', | ||
watercoolers: 'threads', | ||
parents: 'messages', | ||
}; | ||
|
||
(async () => { | ||
const tables = await r | ||
.db('rethinkdb') | ||
.table('table_config') | ||
.filter({ | ||
db: 'spectrum', | ||
}) | ||
.map(rec => rec('name')) | ||
.run(); | ||
|
||
for (const table of tables) { | ||
const [record] = await r | ||
.db('spectrum') | ||
.table(table) | ||
.limit(1) | ||
.run(); | ||
|
||
if (!record) { | ||
// console.warn(`could not find record in table ${table}`); | ||
} else { | ||
let output = `Table ${table} {`; | ||
Object.keys(record).forEach(key => { | ||
let keyType = | ||
key === 'id' || key.endsWith('Id') | ||
? 'uuid' | ||
: key.endsWith('At') | ||
? 'Date' | ||
: type(record[key]); | ||
output += `\n ${key} ${keyType}`; | ||
if (key.endsWith('Id')) { | ||
let refTable = key.replace(/id$/i, '').toLowerCase() + 's'; | ||
refTable = REF_TABLE_MAP[refTable] || refTable; | ||
if (tables.includes(refTable)) { | ||
output += ` [ref: < ${refTable}.id]`; | ||
} | ||
} | ||
}); | ||
output += `\n}\n`; | ||
console.log(output); | ||
} | ||
} | ||
})() | ||
.then(() => { | ||
process.exit(); | ||
}) | ||
.catch(err => { | ||
console.error(err); | ||
process.exit(1); | ||
}); |
Oops, something went wrong.