Drop column funding

This commit is contained in:
ekzyis 2023-09-09 22:52:51 +02:00
parent c2a8968120
commit 8eecf1a981
3 changed files with 2 additions and 4 deletions

View File

@ -16,7 +16,6 @@ CREATE TABLE sessions(
CREATE TABLE markets( CREATE TABLE markets(
id SERIAL PRIMARY KEY, id SERIAL PRIMARY KEY,
description TEXT NOT NULL, description TEXT NOT NULL,
funding BIGINT NOT NULL,
active BOOLEAN DEFAULT true active BOOLEAN DEFAULT true
); );
CREATE EXTENSION "uuid-ossp"; CREATE EXTENSION "uuid-ossp";

View File

@ -13,7 +13,6 @@ import (
type Market struct { type Market struct {
Id int Id int
Description string Description string
Funding int
Active bool Active bool
} }

View File

@ -34,7 +34,7 @@ func (t *Template) Render(w io.Writer, name string, data interface{}, c echo.Con
} }
func index(c echo.Context) error { func index(c echo.Context) error {
rows, err := db.Query("SELECT id, description, funding, active FROM markets WHERE active = true") rows, err := db.Query("SELECT id, description, active FROM markets WHERE active = true")
if err != nil { if err != nil {
return err return err
} }
@ -42,7 +42,7 @@ func index(c echo.Context) error {
var markets []Market var markets []Market
for rows.Next() { for rows.Next() {
var market Market var market Market
rows.Scan(&market.Id, &market.Description, &market.Funding, &market.Active) rows.Scan(&market.Id, &market.Description, &market.Active)
markets = append(markets, market) markets = append(markets, market)
} }
data := map[string]any{ data := map[string]any{