add a bunch of stuff.

This commit is contained in:
2022-03-26 14:53:12 +01:00
parent e44b8b4831
commit 14ffcfd5f6
32 changed files with 837 additions and 89 deletions
@@ -0,0 +1,13 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE scope (
`id` INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`abbreviation` CHAR(8) NOT NULL
)
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE IF EXISTS scope;
-- +goose StatementEnd
@@ -0,0 +1,17 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE scope_member (
`scope_id` INT NOT NULL,
`user_id` CHAR(36) NOT NULL,
`name` VARCHAR(63) NOT NULL,
`owner` BOOLEAN NOT NULL,
PRIMARY KEY (`scope_id`, `user_id`),
UNIQUE (`scope_id`, `name`)
);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE IF EXISTS scope_member;
-- +goose StatementEnd