summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorotofune <otofune@gmail.com>2017-11-07 23:38:18 +0900
committerotofune <otofune@gmail.com>2017-11-08 00:09:05 +0900
commit04dd2cb12bdc5a72ad004802be68c9867efe05a6 (patch)
tree4c03b120e80cba9d12534cd7cce584c312d4b1d8 /tools
parentMerge branch 'master' of https://github.com/syuilo/misskey (diff)
downloadsharkey-04dd2cb12bdc5a72ad004802be68c9867efe05a6.tar.gz
sharkey-04dd2cb12bdc5a72ad004802be68c9867efe05a6.tar.bz2
sharkey-04dd2cb12bdc5a72ad004802be68c9867efe05a6.zip
rename with execution order, add desc & initial creation script
Diffstat (limited to 'tools')
-rwxr-xr-xtools/init-migration-file.sh37
-rw-r--r--tools/migration/README.md3
-rw-r--r--tools/migration/node.1509958623.use-gridfs.js (renamed from tools/migration/use-gridfs.js)0
-rw-r--r--tools/migration/node.1510016282.change-gridfs-metadata-name-to-filename.js (renamed from tools/migration/change-gridfs-metadata-name-to-filename.js)0
-rw-r--r--tools/migration/node.1510056272.issue_882.js (renamed from tools/migration/issue_882.js)0
-rw-r--r--tools/migration/shell.1487734995.user-profile.js (renamed from tools/migration/user-profile.js)0
-rw-r--r--tools/migration/shell.1489951459.like-to-reactions.js (renamed from tools/migration/like-to-reactions.js)0
-rw-r--r--tools/migration/shell.1509507382.reply_to-to-reply.js (renamed from tools/migration/reply_to-to-reply.js)0
8 files changed, 40 insertions, 0 deletions
diff --git a/tools/init-migration-file.sh b/tools/init-migration-file.sh
new file mode 100755
index 0000000000..c6a2b862e6
--- /dev/null
+++ b/tools/init-migration-file.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+usage() {
+ echo "$0 [-t type] [-n name]"
+ echo " type: [node | shell]"
+ echo " name: if no present, set untitled"
+ exit 0
+}
+
+while getopts :t:n:h OPT
+do
+ case $OPT in
+ t) type=$OPTARG
+ ;;
+ n) name=$OPTARG
+ ;;
+ h) usage
+ ;;
+ \?) usage
+ ;;
+ :) usage
+ ;;
+ esac
+done
+
+if [ "$type" = "" ]
+then
+ echo "no type present!!!"
+ usage
+fi
+
+if [ "$name" = "" ]
+then
+ name="untitled"
+fi
+
+touch "$(realpath $(dirname $BASH_SOURCE))/migration/$type.$(date +%s).$name.js"
diff --git a/tools/migration/README.md b/tools/migration/README.md
index cd553efb94..d52e84b35a 100644
--- a/tools/migration/README.md
+++ b/tools/migration/README.md
@@ -1,8 +1,11 @@
Misskeyの破壊的変更に対応するいくつかのスニペットがあります。
MongoDBシェルで実行する必要のあるものとnodeで直接実行する必要のあるものがあります。
+ファイル名が `shell.` から始まるものは前者、 `node.` から始まるものは後者です。
MongoDBシェルで実行する場合、`use`でデータベースを選択しておく必要があります。
nodeで実行するいくつかのスニペットは、並列処理させる数を引数で設定できるものがあります。
処理中にエラーで落ちる場合は、メモリが足りていない可能性があるので、少ない数に設定してみてください。
※デフォルトは`5`です。
+
+ファイルを作成する際は `../init-migration-file.sh -t _type_ -n _name_` を実行すると _type_._unixtime_._name_.js が生成されます
diff --git a/tools/migration/use-gridfs.js b/tools/migration/node.1509958623.use-gridfs.js
index a9d2b12e95..a9d2b12e95 100644
--- a/tools/migration/use-gridfs.js
+++ b/tools/migration/node.1509958623.use-gridfs.js
diff --git a/tools/migration/change-gridfs-metadata-name-to-filename.js b/tools/migration/node.1510016282.change-gridfs-metadata-name-to-filename.js
index 9128d852cf..9128d852cf 100644
--- a/tools/migration/change-gridfs-metadata-name-to-filename.js
+++ b/tools/migration/node.1510016282.change-gridfs-metadata-name-to-filename.js
diff --git a/tools/migration/issue_882.js b/tools/migration/node.1510056272.issue_882.js
index aa11413255..aa11413255 100644
--- a/tools/migration/issue_882.js
+++ b/tools/migration/node.1510056272.issue_882.js
diff --git a/tools/migration/user-profile.js b/tools/migration/shell.1487734995.user-profile.js
index e6666319e1..e6666319e1 100644
--- a/tools/migration/user-profile.js
+++ b/tools/migration/shell.1487734995.user-profile.js
diff --git a/tools/migration/like-to-reactions.js b/tools/migration/shell.1489951459.like-to-reactions.js
index 962a0f00ef..962a0f00ef 100644
--- a/tools/migration/like-to-reactions.js
+++ b/tools/migration/shell.1489951459.like-to-reactions.js
diff --git a/tools/migration/reply_to-to-reply.js b/tools/migration/shell.1509507382.reply_to-to-reply.js
index ceb272ebc9..ceb272ebc9 100644
--- a/tools/migration/reply_to-to-reply.js
+++ b/tools/migration/shell.1509507382.reply_to-to-reply.js