Seed database in the other order
This commit is contained in:
		
							parent
							
								
									114f6a31b8
								
							
						
					
					
						commit
						acee80ce52
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -25,6 +25,9 @@ const utils = require("../m2d/converters/utils")
 | 
				
			||||||
	assert(reg.sender_localpart.startsWith(reg.ooye.namespace_prefix))
 | 
						assert(reg.sender_localpart.startsWith(reg.ooye.namespace_prefix))
 | 
				
			||||||
	assert(utils.eventSenderIsFromDiscord(mxid))
 | 
						assert(utils.eventSenderIsFromDiscord(mxid))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// database ddl...
 | 
				
			||||||
 | 
						db.exec(fs.readFileSync("db/ooye-schema.sql", "utf8"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// ensure homeserver well-known is valid and returns reg.ooye.server_name...
 | 
						// ensure homeserver well-known is valid and returns reg.ooye.server_name...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// upload initial images...
 | 
						// upload initial images...
 | 
				
			||||||
| 
						 | 
					@ -34,9 +37,6 @@ const utils = require("../m2d/converters/utils")
 | 
				
			||||||
	await api.profileSetDisplayname(mxid, "Out Of Your Element")
 | 
						await api.profileSetDisplayname(mxid, "Out Of Your Element")
 | 
				
			||||||
	await api.profileSetAvatarUrl(mxid, avatarUrl)
 | 
						await api.profileSetAvatarUrl(mxid, avatarUrl)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// database ddl...
 | 
					 | 
				
			||||||
	db.exec(fs.readFileSync("db/ooye-schema.sql", "utf8"))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// add initial rows to database, like adding the bot to sim...
 | 
						// add initial rows to database, like adding the bot to sim...
 | 
				
			||||||
	db.prepare("INSERT INTO sim (discord_id, sim_name, localpart, mxid) VALUES (?, ?, ?, ?)").run("0", reg.sender_localpart.slice(reg.ooye.namespace_prefix.length), reg.sender_localpart, mxid)
 | 
						db.prepare("INSERT INTO sim (discord_id, sim_name, localpart, mxid) VALUES (?, ?, ?, ?)").run("0", reg.sender_localpart.slice(reg.ooye.namespace_prefix.length), reg.sender_localpart, mxid)
 | 
				
			||||||
})()
 | 
					})()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue