Drop column funding
This commit is contained in:
parent
c2a8968120
commit
8eecf1a981
1
init.sql
1
init.sql
|
@ -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";
|
||||
|
|
|
@ -13,7 +13,6 @@ import (
|
|||
type Market struct {
|
||||
Id int
|
||||
Description string
|
||||
Funding int
|
||||
Active bool
|
||||
}
|
||||
|
||||
|
|
|
@ -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{
|
||||
|
|
Loading…
Reference in New Issue