maraidb compose file

This commit is contained in:
Chakib Benziane 2019-03-24 12:10:56 +01:00
parent 9b18f725d1
commit 0145558cc8
2 changed files with 20 additions and 10 deletions

View File

@ -1,13 +1,13 @@
version: "3.4"
volumes:
#redis:
db:
file-storage:
sqlite:
gocache:
services:
bit4sat:
app:
image: sp4ke/bit4sat
build: ./docker
environment:
@ -30,11 +30,21 @@ services:
working_dir: /src
maria:
image: mariadb:latest
environment:
- MYSQL_ROOT_PASSWORD=pass
- MYSQL_DATABASE=bit4sat
- MYSQL_USER=bit4sat
- MYSQL_PASSWORD=bit4sat
volumes:
- db:/var/lib/mysql
#redis:
#image: redis:alpine
#volumes:
#- redis:/data
#- db:/data
#command:
#- redis-server

View File

@ -15,13 +15,13 @@ var DB = db.DB
const (
DBUploadSchema = `
CREATE TABLE IF NOT EXISTS "upload" (
upload_id TEXT NOT NULL,
sha256 TEXT NOT NULL,
file_name TEXT NOT NULL,
file_type TEXT DEFAULT '',
file_size INTEGER NOT NULL,
file_ext TEXT DEFAULT '',
status INTEGER DEFAULT 0,
upload_id CHAR(20) NOT NULL,
sha256 CHAR(32) NOT NULL,
file_name CHAR(255) NOT NULL,
file_type CHAR(255) DEFAULT '',
file_size INT NOT NULL,
file_ext CHAR(255) DEFAULT '',
status INT DEFAULT 0,
FOREIGN KEY (status) REFERENCES upload_status(type),
UNIQUE (upload_id, sha256)
);