summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorCadence Ember <cadence@disroot.org>2023-09-12 19:23:23 +1200
committerCadence Ember <cadence@disroot.org>2023-09-12 19:23:23 +1200
commitacee80ce52bb64b12d3fcb55cf7cedaaa5a61635 (patch)
tree1e1ea2142a53d6c3ea4b4e4ab620308001e7c8e2 /scripts
parentmore benefits on readme (diff)
downloadout-of-your-element-acee80ce52bb64b12d3fcb55cf7cedaaa5a61635.tar.xz
Seed database in the other order
Diffstat (limited to 'scripts')
-rw-r--r--scripts/seed.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/seed.js b/scripts/seed.js

index 444cee9..be2d5f3 100644 --- a/scripts/seed.js +++ b/scripts/seed.js
@@ -25,6 +25,9 @@ const utils = require("../m2d/converters/utils") assert(reg.sender_localpart.startsWith(reg.ooye.namespace_prefix)) 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... // upload initial images... @@ -34,9 +37,6 @@ const utils = require("../m2d/converters/utils") await api.profileSetDisplayname(mxid, "Out Of Your Element") 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... 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) })()