Creating db in executable.
This commit is contained in:
@@ -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);"))
|
||||
|
||||
Reference in New Issue
Block a user