2024-04-09 22:37:26 +07:00
|
|
|
-- +goose Up
|
|
|
|
-- +goose StatementBegin
|
|
|
|
CREATE TABLE devices(
|
2024-05-04 22:17:10 +07:00
|
|
|
slug VARCHAR(255) NOT NULL PRIMARY KEY COLLATE NOCASE,
|
2024-04-26 22:13:04 +07:00
|
|
|
enable INTEGER NOT NULL DEFAULT 1,
|
2024-05-04 22:17:10 +07:00
|
|
|
name VARCHAR(255) NOT NULL COLLATE NOCASE,
|
2024-04-09 22:37:26 +07:00
|
|
|
resolution_x DOUBLE NOT NULL,
|
|
|
|
resolution_y DOUBLE NOT NULL,
|
|
|
|
aspect_ratio_tolerance DOUBLE NOT NULL default 0.2,
|
|
|
|
min_x INTEGER NOT NULL DEFAULT 0,
|
|
|
|
min_y INTEGER NOT NULL DEFAULT 0,
|
|
|
|
max_x INTEGER NOT NULL DEFAULT 0,
|
|
|
|
max_y INTEGER NOT NULL DEFAULT 0,
|
|
|
|
nsfw INTEGER NOT NULL DEFAULT 0,
|
2024-04-14 00:32:55 +07:00
|
|
|
windows_wallpaper_mode INTEGER NOT NULL DEFAULT 0,
|
2024-04-29 21:45:18 +07:00
|
|
|
created_at BIGINT DEFAULT 0 NOT NULL,
|
|
|
|
updated_at BIGINT DEFAULT 0 NOT NULL
|
2024-04-09 22:37:26 +07:00
|
|
|
);
|
|
|
|
|
2024-04-14 17:30:04 +07:00
|
|
|
CREATE UNIQUE INDEX idx_devices_name ON devices(slug);
|
2024-04-09 22:37:26 +07:00
|
|
|
|
2024-04-26 22:13:04 +07:00
|
|
|
CREATE INDEX idx_devices_enable ON devices(enable);
|
2024-04-09 22:37:26 +07:00
|
|
|
-- +goose StatementEnd
|
|
|
|
|
|
|
|
-- +goose Down
|
|
|
|
-- +goose StatementBegin
|
|
|
|
DROP TABLE IF EXISTS devices;
|
|
|
|
-- +goose StatementEnd
|