refactor: Show template versions as timeline (#4800)

This commit is contained in:
Bruno Quaresma
2022-10-31 13:38:07 -03:00
committed by GitHub
parent cc655672eb
commit 46e0953876
21 changed files with 218 additions and 218 deletions

View File

@ -327,7 +327,7 @@ CREATE TABLE template_versions (
name character varying(64) NOT NULL,
readme character varying(1048576) NOT NULL,
job_id uuid NOT NULL,
created_by uuid
created_by uuid NOT NULL
);
CREATE TABLE templates (

View File

@ -0,0 +1 @@
ALTER TABLE template_versions ALTER COLUMN created_by DROP NOT NULL;

View File

@ -0,0 +1,4 @@
BEGIN;
ALTER TABLE template_versions ALTER COLUMN created_by SET NOT NULL;
UPDATE template_versions SET created_by = '00000000-0000-0000-0000-000000000000'::uuid WHERE created_by IS NULL;
COMMIT;

View File

@ -600,7 +600,7 @@ type TemplateVersion struct {
Name string `db:"name" json:"name"`
Readme string `db:"readme" json:"readme"`
JobID uuid.UUID `db:"job_id" json:"job_id"`
CreatedBy uuid.NullUUID `db:"created_by" json:"created_by"`
CreatedBy uuid.UUID `db:"created_by" json:"created_by"`
}
type User struct {

View File

@ -3634,7 +3634,7 @@ type InsertTemplateVersionParams struct {
Name string `db:"name" json:"name"`
Readme string `db:"readme" json:"readme"`
JobID uuid.UUID `db:"job_id" json:"job_id"`
CreatedBy uuid.NullUUID `db:"created_by" json:"created_by"`
CreatedBy uuid.UUID `db:"created_by" json:"created_by"`
}
func (q *sqlQuerier) InsertTemplateVersion(ctx context.Context, arg InsertTemplateVersionParams) (TemplateVersion, error) {