Files
archived-web-api/db/migrations/20231128032010_create-release-table.sql
Tyler Wilding f4dfb6045a API Rewrite and Dockerization (#78)
* workers: init

* workers: d1 initial work

* workers: resuming work, simplified schema

* api: flesh out the majority of critical features

* api: get rid of the old implementation

* db: seed database with current releases

* db: break seed files up, too much for a single stdout buffer

* api: support version diff'ing

* d1: debugging insert issue

* api: fix insert issue (missing `await`s) and explicitly cache to avoid invocations

* api: append CORS headers for requests originating from `pcsx2.net`

* api: update seed data and fix response data

* api: optimize DB indexes and add caching

* api: update page rule cache when a release is added/deleted/modified

* api: most functionality ported over to rocket.rs

* api: finish off core implementation

* api: dockerize

* api: cleaning up TODOs

* v1: remove some of the old implementation

* v2: small script to pull release data, update DB seed

* v2: minor cleanup

* v2: finalize v1 -> v2 transition

* v2: synchronize db on startup

* sqlx: commit sql query metadata

* v2: handful of bug fixes and v1 parity adjustments

* v2: some repo house cleaning

* ci: add CI workflows

* ci: finalize ci implementation
2025-02-26 20:31:03 -05:00

28 lines
1.1 KiB
SQL

-- Add migration script here
CREATE TABLE IF NOT EXISTS `releases` (
`id` integer not null primary key autoincrement,
`version` TEXT not null,
`version_integral` INTEGER not null,
`published_timestamp` TEXT not null,
`created_timestamp` TEXT not null,
`github_release_id` INTEGER not null,
`github_url` TEXT not null,
`release_type` TEXT not null,
`next_audit` TEXT not null,
`next_audit_days` INTEGER not null,
`archived` INTEGER DEFAULT 0 not null,
`notes` TEXT null,
`assets` TEXT DEFAULT "[]" not null
-- JSON
-- `download_url` TEXT not null,
-- `platform` TEXT not null,
-- `tags` TEXT null, /* JSON array */
-- `download_count` integer null,
-- `download_size_bytes` integer null
);
CREATE UNIQUE INDEX IF NOT EXISTS releases_index_version ON releases (version);
-- For list query optimization
CREATE INDEX IF NOT EXISTS idx_releases_type_archived_version_integral ON releases (release_type, archived, version_integral DESC);
-- For changelog query optimization
CREATE INDEX IF NOT EXISTS idx_releases_archived_version_integral ON releases (archived, version_integral DESC);