Creating db in executable.

master
Thomas Hintz 1 year ago
parent a4c41785ce
commit c764b63d10

@ -52,7 +52,6 @@ RUN cp src/server/farm dist/; \
FROM farm as run
WORKDIR /farm/dist
RUN touch /farmdb/db
ENTRYPOINT ["./farm"]
CMD ["-:a50"]
# CMD ./farm

@ -11,6 +11,11 @@
body ...)))))
(define (create-tables)
(when (not (file-exists? *db*))
(call-with-output-file *db*
(lambda (output-port)
;; Empty body, no content to write to the file
)))
(with-db (db)
(exec (sql db "create table if not exists users(id INTEGER PRIMARY KEY, username TEXT, email TEXT, password TEXT, salt TEXT);"))
(exec (sql db "create table if not exists sessions(bindings TEXT, session_id TEXT PRIMARY KEY);"))

Loading…
Cancel
Save