Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions db/migrations/mysql/20260131021850_add_chunks.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CREATE TABLE chunks (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
hash VARCHAR(64) NOT NULL UNIQUE,
size INT UNSIGNED NOT NULL,
compressed_size INT UNSIGNED NOT NULL DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated_at TIMESTAMP NULL DEFAULT NULL
);
Expand Down
1 change: 1 addition & 0 deletions db/migrations/postgres/20260131021850_add_chunks.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CREATE TABLE chunks (
id BIGSERIAL PRIMARY KEY,
hash TEXT NOT NULL UNIQUE,
size INTEGER NOT NULL CHECK (size >= 0),
compressed_size INTEGER NOT NULL DEFAULT 0 CHECK (compressed_size >= 0),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated_at TIMESTAMPTZ
);
Expand Down
1 change: 1 addition & 0 deletions db/migrations/sqlite/20260131021850_add_chunks.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CREATE TABLE chunks (
id INTEGER PRIMARY KEY AUTOINCREMENT,
hash TEXT NOT NULL UNIQUE,
size INTEGER NOT NULL CHECK (size >= 0),
compressed_size INTEGER NOT NULL DEFAULT 0 CHECK (compressed_size >= 0),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated_at TIMESTAMP
);
Expand Down
1 change: 1 addition & 0 deletions db/schema/mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ CREATE TABLE `chunks` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`hash` varchar(64) NOT NULL,
`size` int(10) unsigned NOT NULL,
`compressed_size` int(10) unsigned NOT NULL DEFAULT 0,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
Expand Down
2 changes: 2 additions & 0 deletions db/schema/postgres.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ CREATE TABLE public.chunks (
id bigint NOT NULL,
hash text NOT NULL,
size integer NOT NULL,
compressed_size integer DEFAULT 0 NOT NULL,
created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated_at timestamp with time zone,
CONSTRAINT chunks_compressed_size_check CHECK ((compressed_size >= 0)),
CONSTRAINT chunks_size_check CHECK ((size >= 0))
);

Expand Down
1 change: 1 addition & 0 deletions db/schema/sqlite.sql
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ CREATE TABLE chunks (
id INTEGER PRIMARY KEY AUTOINCREMENT,
hash TEXT NOT NULL UNIQUE,
size INTEGER NOT NULL CHECK (size >= 0),
compressed_size INTEGER NOT NULL DEFAULT 0 CHECK (compressed_size >= 0),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated_at TIMESTAMP
);
Expand Down
35 changes: 30 additions & 5 deletions pkg/database/generated_models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions pkg/database/generated_querier.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 14 additions & 10 deletions pkg/database/generated_wrapper_mysql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 16 additions & 10 deletions pkg/database/generated_wrapper_postgres.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading