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(
id SERIAL PRIMARY KEY,
description TEXT NOT NULL,
funding BIGINT NOT NULL,
active BOOLEAN DEFAULT true
);
CREATE EXTENSION "uuid-ossp";

View File

@ -13,7 +13,6 @@ import (
type Market struct {
Id int
Description string
Funding int
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 {
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 {
return err
}
@ -42,7 +42,7 @@ func index(c echo.Context) error {
var markets []Market
for rows.Next() {
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)
}
data := map[string]any{