From ff061724189fb0c3df33f21f736c36cee38f71ad Mon Sep 17 00:00:00 2001 From: Jonathan Chappelow Date: Fri, 22 Mar 2024 14:32:26 -0500 Subject: [PATCH] unremove voting.height --- internal/voting/sql.go | 5 +++++ internal/voting/voting.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/voting/sql.go b/internal/voting/sql.go index 232e78271..574906dfd 100644 --- a/internal/voting/sql.go +++ b/internal/voting/sql.go @@ -51,6 +51,11 @@ const ( id BYTEA PRIMARY KEY );` + tableHeight = `CREATE TABLE IF NOT EXISTS ` + votingSchemaName + `.height ( + name TEXT PRIMARY KEY, -- name is 'height' + height INT NOT NULL + );` + dropHeightTable = `DROP TABLE IF EXISTS ` + votingSchemaName + `.height` // ensureResolutionIDExists is the sql statement used to ensure a resolution ID is present in the resolutions table diff --git a/internal/voting/voting.go b/internal/voting/voting.go index c922f2db2..c99951ad5 100644 --- a/internal/voting/voting.go +++ b/internal/voting/voting.go @@ -42,7 +42,7 @@ func dropHeight(ctx context.Context, db sql.DB) error { func initTables(ctx context.Context, db sql.DB) error { initStmts := []string{ //createVotingSchema, tableVoters, tableResolutionTypes, tableResolutions, - resolutionsTypeIndex, tableProcessed, tableVotes} // order important + resolutionsTypeIndex, tableProcessed, tableVotes, tableHeight} // order important for _, stmt := range initStmts { _, err := db.Execute(ctx, stmt)