woodpecker/server/store/datastore/ddl/postgres/files/006_create_table_files.sql
Jacob Floyd 5fe712cca6
Move package store/ to server/store/ (#341)
* Refactor: move store/ to server/store/

* fix pipeline for moved tests

Co-authored-by: 6543 <6543@obermui.de>
2021-09-23 13:33:59 +02:00

23 lines
509 B
SQL

-- name: create-table-files
CREATE TABLE IF NOT EXISTS files (
file_id SERIAL PRIMARY KEY
,file_build_id INTEGER
,file_proc_id INTEGER
,file_name VARCHAR(250)
,file_mime VARCHAR(250)
,file_size INTEGER
,file_time INTEGER
,file_data BYTEA
,UNIQUE(file_proc_id,file_name)
);
-- name: create-index-files-builds
CREATE INDEX IF NOT EXISTS file_build_ix ON files (file_build_id);
-- name: create-index-files-procs
CREATE INDEX IF NOT EXISTS file_proc_ix ON files (file_proc_id);