32 lines
693 B
Bash
32 lines
693 B
Bash
#!/bin/bash
|
|
|
|
|
|
cat <<'EOF' | sqlite3 "$1"
|
|
|
|
CREATE TABLE IF NOT EXISTS files (
|
|
token text PRIMARY KEY,
|
|
name text NOT NULL,
|
|
added integer NOT NULL,
|
|
expires integer NOT NULL,
|
|
downloads integer NOT NULL,
|
|
max_downloads integer NOT NULL,
|
|
passhash text,
|
|
allowed_ip text,
|
|
hidden boolean
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS upload_tokens (
|
|
token text PRIMARY KEY,
|
|
added integer NOT NULL,
|
|
expires integer NOT NULL
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS tasks (
|
|
key text PRIMARY KEY,
|
|
value integer NOT NULL
|
|
);
|
|
|
|
INSERT OR IGNORE INTO tasks(key,value) VALUES('maintenance',0);
|
|
|
|
EOF
|