Gisle Aune
3 years ago
8 changed files with 104 additions and 76 deletions
-
18scripts/goose-mysql/20220326173144_stat.sql
-
18scripts/goose-mysql/20220326174046_project.sql
-
6src/lib/database/interfaces.ts
-
53src/lib/database/mysql/scopes.ts
-
11src/lib/models/project.ts
-
2src/lib/models/scope.ts
-
66src/routes/[scope].json.ts
-
6src/routes/[scope]/__layout.svelte
@ -0,0 +1,18 @@ |
|||
-- +goose Up |
|||
-- +goose StatementBegin |
|||
CREATE TABLE stat ( |
|||
`id` INT NOT NULL PRIMARY KEY AUTO_INCREMENT, |
|||
`scope_id` INT NOT NULL, |
|||
`name` VARCHAR(255) NOT NULL, |
|||
`description` TEXT NOT NULL, |
|||
`weight` FLOAT NOT NULL, |
|||
`allowed_amounts` JSON, |
|||
|
|||
UNIQUE (`scope_id`, `name`) |
|||
); |
|||
-- +goose StatementEnd |
|||
|
|||
-- +goose Down |
|||
-- +goose StatementBegin |
|||
SELECT 'down SQL query'; |
|||
-- +goose StatementEnd |
@ -0,0 +1,18 @@ |
|||
-- +goose Up |
|||
-- +goose StatementBegin |
|||
CREATE TABLE IF NOT EXISTS 'project' ( |
|||
`id` INT NOT NULL AUTO_INCREMENT, |
|||
`scope_id` INT NOT NULL, |
|||
`author_id` CHAR(36) NOT NULL, |
|||
`name` VARCHAR(255) NOT NULL, |
|||
`status` INT NOT NULL, |
|||
`description` TEXT NOT NULL, |
|||
|
|||
UNIQUE (`scope_id`, `name`) |
|||
) |
|||
-- +goose StatementEnd |
|||
|
|||
-- +goose Down |
|||
-- +goose StatementBegin |
|||
SELECT 'down SQL query'; |
|||
-- +goose StatementEnd |
Write
Preview
Loading…
Cancel
Save
Reference in new issue