add dat base

This commit is contained in:
2022-12-31 17:17:10 +01:00
parent 6fb82df153
commit 4ff22d7d63
27 changed files with 1337 additions and 36 deletions
@@ -0,0 +1,16 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE device_info
(
id VARCHAR(255) NOT NULL,
kind VARCHAR(255) NOT NULL,
data JSON NOT NULL,
PRIMARY KEY (id, kind)
);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE device_info;
-- +goose StatementEnd
@@ -0,0 +1,15 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE device_assignment
(
id CHAR(36) NOT NULL PRIMARY KEY,
created_date TIMESTAMP NOT NULL,
`match` TEXT NOT NULL,
effect JSON NOT NULL
);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE device_assignment;
-- +goose StatementEnd
@@ -0,0 +1,14 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE device_auth
(
id VARCHAR(255) NOT NULL PRIMARY KEY,
api_key TEXT NOT NULL,
extras JSON NOT NULL
);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE device_auth;
-- +goose StatementEnd
@@ -0,0 +1,15 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE device_alias
(
id VARCHAR(255) NOT NULL,
alias VARCHAR(1023) NOT NULL,
PRIMARY KEY (id, alias)
);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE device_alias;
-- +goose StatementEnd