// Code generated by go generate; DO NOT EDIT.
package db

import (
	"agola.io/agola/internal/sqlg"
)
var DDLPostgres = []string{
	"create table if not exists changegroup (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamptz NOT NULL, update_time timestamptz NOT NULL, name varchar NOT NULL, value varchar NOT NULL, PRIMARY KEY (id))",
	"create table if not exists runconfig (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamptz NOT NULL, update_time timestamptz NOT NULL, name varchar NOT NULL, run_group varchar NOT NULL, setup_errors jsonb NOT NULL, annotations jsonb NOT NULL, static_environment jsonb NOT NULL, environment jsonb NOT NULL, tasks jsonb NOT NULL, cache_group varchar NOT NULL, PRIMARY KEY (id))",
	"create table if not exists run (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamptz NOT NULL, update_time timestamptz NOT NULL, sequence bigint generated by default as identity NOT NULL UNIQUE, name varchar NOT NULL, run_config_id varchar NOT NULL, counter bigint NOT NULL, run_group varchar NOT NULL, annotations jsonb NOT NULL, phase varchar NOT NULL, result varchar NOT NULL, stop boolean NOT NULL, tasks jsonb NOT NULL, enqueue_time timestamptz, start_time timestamptz, end_time timestamptz, archived boolean NOT NULL, PRIMARY KEY (id), foreign key (run_config_id) references runconfig(id))",
	"create table if not exists runcounter (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamptz NOT NULL, update_time timestamptz NOT NULL, group_id varchar NOT NULL UNIQUE, value bigint NOT NULL, PRIMARY KEY (id))",
	"create table if not exists runevent (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamptz NOT NULL, update_time timestamptz NOT NULL, sequence bigint generated by default as identity NOT NULL UNIQUE, run_event_type varchar NOT NULL, run_id varchar NOT NULL, phase varchar NOT NULL, result varchar NOT NULL, data jsonb NOT NULL, data_version bigint NOT NULL, PRIMARY KEY (id))",
	"create table if not exists executor (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamptz NOT NULL, update_time timestamptz NOT NULL, executor_id varchar NOT NULL, listen_url varchar NOT NULL, archs jsonb NOT NULL, labels jsonb NOT NULL, allow_privileged_containers boolean NOT NULL, active_tasks_limit bigint NOT NULL, active_tasks bigint NOT NULL, dynamic boolean NOT NULL, executor_group varchar NOT NULL, siblings_executors jsonb NOT NULL, PRIMARY KEY (id))",
	"create table if not exists executortask (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamptz NOT NULL, update_time timestamptz NOT NULL, executor_id varchar NOT NULL, run_id varchar NOT NULL, run_task_id varchar NOT NULL, stop boolean NOT NULL, phase varchar NOT NULL, timedout boolean NOT NULL, fail_error varchar NOT NULL, start_time timestamptz, end_time timestamptz, setup_step jsonb NOT NULL, steps jsonb NOT NULL, PRIMARY KEY (id))",

	// indexes
	"create index if not exists run_group_idx on run(run_group)",
	"create index if not exists runcounter_group_id_idx on runcounter(group_id)",
}
var DDLSqlite3 = []string{
	"create table if not exists changegroup (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamp NOT NULL, update_time timestamp NOT NULL, name varchar NOT NULL, value varchar NOT NULL, PRIMARY KEY (id))",
	"create table if not exists runconfig (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamp NOT NULL, update_time timestamp NOT NULL, name varchar NOT NULL, run_group varchar NOT NULL, setup_errors text NOT NULL, annotations text NOT NULL, static_environment text NOT NULL, environment text NOT NULL, tasks text NOT NULL, cache_group varchar NOT NULL, PRIMARY KEY (id))",
	"create table if not exists run (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamp NOT NULL, update_time timestamp NOT NULL, sequence integer NOT NULL UNIQUE, name varchar NOT NULL, run_config_id varchar NOT NULL, counter bigint NOT NULL, run_group varchar NOT NULL, annotations text NOT NULL, phase varchar NOT NULL, result varchar NOT NULL, stop integer NOT NULL, tasks text NOT NULL, enqueue_time timestamp, start_time timestamp, end_time timestamp, archived integer NOT NULL, PRIMARY KEY (id), foreign key (run_config_id) references runconfig(id))",
	"create table if not exists runcounter (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamp NOT NULL, update_time timestamp NOT NULL, group_id varchar NOT NULL UNIQUE, value bigint NOT NULL, PRIMARY KEY (id))",
	"create table if not exists runevent (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamp NOT NULL, update_time timestamp NOT NULL, sequence integer NOT NULL UNIQUE, run_event_type varchar NOT NULL, run_id varchar NOT NULL, phase varchar NOT NULL, result varchar NOT NULL, data text NOT NULL, data_version bigint NOT NULL, PRIMARY KEY (id))",
	"create table if not exists executor (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamp NOT NULL, update_time timestamp NOT NULL, executor_id varchar NOT NULL, listen_url varchar NOT NULL, archs text NOT NULL, labels text NOT NULL, allow_privileged_containers integer NOT NULL, active_tasks_limit bigint NOT NULL, active_tasks bigint NOT NULL, dynamic integer NOT NULL, executor_group varchar NOT NULL, siblings_executors text NOT NULL, PRIMARY KEY (id))",
	"create table if not exists executortask (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamp NOT NULL, update_time timestamp NOT NULL, executor_id varchar NOT NULL, run_id varchar NOT NULL, run_task_id varchar NOT NULL, stop integer NOT NULL, phase varchar NOT NULL, timedout integer NOT NULL, fail_error varchar NOT NULL, start_time timestamp, end_time timestamp, setup_step text NOT NULL, steps text NOT NULL, PRIMARY KEY (id))",

	// indexes
	"create index if not exists run_group_idx on run(run_group)",
	"create index if not exists runcounter_group_id_idx on runcounter(group_id)",
}

var Sequences = []sqlg.Sequence {
	{
		Name:   "run_sequence_seq",
		Table:  "run",
		Column: "sequence",
	},
	{
		Name:   "runevent_sequence_seq",
		Table:  "runevent",
		Column: "sequence",
	},
}
