🍕
This commit is contained in:
		
							parent
							
								
									10f6d5980f
								
							
						
					
					
						commit
						69c452a980
					
				
					 19 changed files with 28 additions and 748 deletions
				
			
		
							
								
								
									
										11
									
								
								migration/README.md
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								migration/README.md
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,11 @@ | |||
| Misskeyの破壊的変更に対応するいくつかのスニペットがあります。 | ||||
| MongoDBシェルで実行する必要のあるものとnodeで直接実行する必要のあるものがあります。 | ||||
| ファイル名が `shell.` から始まるものは前者、 `node.` から始まるものは後者です。 | ||||
| 
 | ||||
| MongoDBシェルで実行する場合、`use`でデータベースを選択しておく必要があります。 | ||||
| 
 | ||||
| nodeで実行するいくつかのスニペットは、並列処理させる数を引数で設定できるものがあります。 | ||||
| 処理中にエラーで落ちる場合は、メモリが足りていない可能性があるので、少ない数に設定してみてください。 | ||||
| ※デフォルトは`5`です。 | ||||
| 
 | ||||
| ファイルを作成する際は `../init-migration-file.sh -t _type_ -n _name_` を実行すると _type_._unixtime_._name_.js が生成されます | ||||
							
								
								
									
										37
									
								
								migration/init-migration-file.sh
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								migration/init-migration-file.sh
									
										
									
									
									
										Normal file
									
								
							|  | @ -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" | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue