Skip to content

Commit

Permalink
unremove voting.height
Browse files Browse the repository at this point in the history
  • Loading branch information
jchappelow committed Mar 25, 2024
1 parent 8326adf commit ff06172
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions internal/voting/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/voting/voting.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ff06172

Please sign in to comment.