mirror of
https://github.com/modrinth/code.git
synced 2026-08-31 03:55:59 +00:00
* pnpm prepr * feat(instance-sync): screenshots sync * fix: prepr + fmt * fix: qa * feat: screenshit editor * feat: screenshot* editor qa * fix: qa * fix: lint * fix: aecsocket rev * qa: a11y tab navigation focus is cut off * qa: Change “Edited” badge to be bg-highlight-green * qa: friends list input style wrong * qa: toolbar width + labels * qa: multiselect changes * qa: anim changes * qa: card hover colors * qa: copy feedback * qa: hide date * qa: instance icon in overflow/contextmenu * qa: spacing * qa: group empty state text * qa: drag preview badge * qa: group deletion skip warning if no screenshots * qa: redesign editor * qa: remove screenshot parent/edited badge stuff * qa: control font size consistency * qa: viewer copy control * qa: editor fixes * qa: redirect on disable screenshot sync * qa: margin police * fix: crop * fix: qa * feat: initial start on basic instance file syncing (#7220) * qa: final * qa: final 2 * fix: lint + prepr * fix: copy * fix: screenshot editing outside of app causing ghost files in db + sync fail rollback impl * chore: split up * fix: fmt --------- Co-authored-by: tdgao <mr.trumgao@gmail.com>
42 lines
1.1 KiB
SQL
42 lines
1.1 KiB
SQL
CREATE TABLE screenshots (
|
|
id TEXT NOT NULL,
|
|
instance_id TEXT NOT NULL,
|
|
file_name TEXT NOT NULL,
|
|
content_hash TEXT NOT NULL,
|
|
file_size INTEGER NOT NULL,
|
|
modified_at INTEGER NOT NULL,
|
|
created_at INTEGER NOT NULL,
|
|
|
|
PRIMARY KEY (id),
|
|
UNIQUE (instance_id, file_name),
|
|
FOREIGN KEY (instance_id) REFERENCES instances(id) ON DELETE CASCADE
|
|
);
|
|
|
|
CREATE INDEX screenshots_instance_id ON screenshots(instance_id);
|
|
CREATE INDEX screenshots_instance_hash
|
|
ON screenshots(instance_id, content_hash, file_size);
|
|
|
|
CREATE TABLE screenshot_groups (
|
|
id TEXT NOT NULL,
|
|
name TEXT NOT NULL,
|
|
display_order INTEGER NOT NULL DEFAULT 0,
|
|
|
|
PRIMARY KEY (id),
|
|
CHECK (length(trim(name)) > 0)
|
|
);
|
|
|
|
CREATE INDEX screenshot_groups_display_order
|
|
ON screenshot_groups(display_order);
|
|
|
|
CREATE TABLE screenshot_group_memberships (
|
|
screenshot_id TEXT NOT NULL,
|
|
group_id TEXT NOT NULL,
|
|
|
|
PRIMARY KEY (screenshot_id),
|
|
FOREIGN KEY (screenshot_id) REFERENCES screenshots(id) ON DELETE CASCADE,
|
|
FOREIGN KEY (group_id) REFERENCES screenshot_groups(id) ON DELETE CASCADE
|
|
);
|
|
|
|
CREATE INDEX screenshot_group_memberships_group_id
|
|
ON screenshot_group_memberships(group_id);
|