add logging.

This commit is contained in:
2020-05-24 16:30:25 +02:00
parent e2c3b53d50
commit a4c019e67b
22 changed files with 883 additions and 30 deletions
@@ -1,15 +1,15 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE issue_item (
issue_item_id CHAR(48) NOT NULL PRIMARY KEY,
issue_id CHAR(32) NOT NULL,
item_id CHAR(32) NOT NULL,
quantity INTEGER NOT NULL,
acquired BOOLEAN NOT NULL,
issue_item_id CHAR(48) NOT NULL PRIMARY KEY,
issue_id CHAR(32) NOT NULL,
item_id CHAR(32) NOT NULL,
quantity INTEGER NOT NULL,
acquired BOOLEAN NOT NULL,
INDEX (acquired),
INDEX (issue_id),
INDEX (item_id)
INDEX (acquired),
INDEX (issue_id),
INDEX (item_id)
);
-- +goose StatementEnd
@@ -0,0 +1,17 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE log (
log_id CHAR(24) NOT NULL PRIMARY KEY,
user_id CHAR(32) NOT NULL,
date TIMESTAMP NOT NULL,
description TEXT NOT NULL,
INDEX (user_id),
INDEX (date)
);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE log;
-- +goose StatementEnd
@@ -0,0 +1,18 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE log_item (
log_id CHAR(24) NOT NULL,
issue_id CHAR(32) NOT NULL,
issue_item_id CHAR(48) NOT NULL,
amount INTEGER NOT NULL,
PRIMARY KEY(log_id, issue_item_id),
INDEX (issue_item_id),
INDEX (issue_id)
);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE log_item;
-- +goose StatementEnd
@@ -0,0 +1,19 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE log_task (
log_id CHAR(24) NOT NULL,
issue_id CHAR(32) NOT NULL,
issue_task_id CHAR(48) NOT NULL,
units INTEGER,
duration BIGINT NOT NULL,
PRIMARY KEY(log_id, issue_task_id),
INDEX (issue_task_id),
INDEX (issue_id)
);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE log_task;
-- +goose StatementEnd