Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
drone/store/shared/migrate/postgres/files/005_create_table_stages.sql
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
44 lines (37 sloc)
1.22 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- name: create-table-stages | |
| CREATE TABLE IF NOT EXISTS stages ( | |
| stage_id SERIAL PRIMARY KEY | |
| ,stage_repo_id INTEGER | |
| ,stage_build_id INTEGER | |
| ,stage_number INTEGER | |
| ,stage_name VARCHAR(100) | |
| ,stage_kind VARCHAR(50) | |
| ,stage_type VARCHAR(50) | |
| ,stage_status VARCHAR(50) | |
| ,stage_error VARCHAR(500) | |
| ,stage_errignore BOOLEAN | |
| ,stage_exit_code INTEGER | |
| ,stage_limit INTEGER | |
| ,stage_os VARCHAR(50) | |
| ,stage_arch VARCHAR(50) | |
| ,stage_variant VARCHAR(10) | |
| ,stage_kernel VARCHAR(50) | |
| ,stage_machine VARCHAR(500) | |
| ,stage_started INTEGER | |
| ,stage_stopped INTEGER | |
| ,stage_created INTEGER | |
| ,stage_updated INTEGER | |
| ,stage_version INTEGER | |
| ,stage_on_success BOOLEAN | |
| ,stage_on_failure BOOLEAN | |
| ,stage_depends_on TEXT | |
| ,stage_labels TEXT | |
| ,UNIQUE(stage_build_id, stage_number) | |
| ); | |
| -- name: create-index-stages-build | |
| CREATE INDEX IF NOT EXISTS ix_stages_build ON stages (stage_build_id); | |
| -- name: create-index-stages-status | |
| CREATE INDEX IF NOT EXISTS ix_stage_in_progress ON stages (stage_status) | |
| WHERE stage_status IN ('pending', 'running'); | |
| -- name: alter-table-stages-add-column-limit-repos | |
| ALTER TABLE stages ADD COLUMN stage_limit_repo INTEGER NOT NULL DEFAULT 0; |