Add migration fixes
This commit is contained in:
@@ -33,6 +33,10 @@ func DbMainpage(pool *pgxpool.Pool) gin.H {
|
||||
log.Println(err.Error())
|
||||
}
|
||||
|
||||
persons = append(persons, models.Person{
|
||||
Id: -1,
|
||||
Name: "-- Auswählen --",
|
||||
})
|
||||
var person models.Person
|
||||
for wperson.Next() {
|
||||
err = wperson.Scan(&person.Id, &person.Name)
|
||||
|
@@ -0,0 +1,3 @@
|
||||
--
|
||||
-- DROP/Reverse everything here
|
||||
--
|
@@ -0,0 +1,3 @@
|
||||
ALTER TABLE public.washlist DROP COLUMN washed;
|
||||
ALTER TABLE public.washlist
|
||||
ADD COLUMN washed integer;
|
@@ -0,0 +1,3 @@
|
||||
--
|
||||
-- DROP/Reverse everything here
|
||||
--
|
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE public.washlist
|
||||
ALTER COLUMN washed SET DEFAULT -1;
|
@@ -15,7 +15,6 @@
|
||||
<tr>
|
||||
<th>Person</th>
|
||||
<th>Datum</th>
|
||||
<th>Gewaschen?</th>
|
||||
<th>Waschperson</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -26,15 +25,18 @@
|
||||
<tr>
|
||||
<td>{{$item.Person}}</td>
|
||||
<td>{{$item.Date}}</td>
|
||||
<td>{{$item.Washed}}</td>
|
||||
<td>
|
||||
<div class="center">
|
||||
<form class="ui form" action="/uploadname" method="POST">
|
||||
<input type="hidden" id="washid" name="washid" value="{{ $item.Id}}">
|
||||
<select name="names" id="names">
|
||||
<option value="-1" selected></option>
|
||||
<!--<option value="-1" selected disabled hidden>Choose here</option>-->
|
||||
{{range $person := $persons}}
|
||||
<option value="{{$person.Id}}">{{$person.Name}}</option>
|
||||
{{if eq $item.Washed $person.Id}}
|
||||
<option value="{{$person.Id}}" selected>{{$person.Name}}</option>
|
||||
{{else}}
|
||||
<option value="{{$person.Id}}">{{$person.Name}}</option>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</select>
|
||||
<input type="submit" value="Speichern">
|
||||
|
@@ -1,10 +1,9 @@
|
||||
{{define "navbar"}}
|
||||
<div class="ui inverted menu">
|
||||
<a href="/"><div class="header item">Trikotwaschliste</div></a>
|
||||
<a href="/"><div class="header item">Personen</div></a>
|
||||
|
||||
<div class="right menu">
|
||||
<a href="/querypage/create"><div class="item">Query</div></a>
|
||||
<a href="/stats/interpret"><div class="item">Stats</div></a>
|
||||
<a href="/credits"><div class="item">Credits</div></a>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -6,5 +6,5 @@ type Washlist struct {
|
||||
Id int `json:"id"`
|
||||
Person string `json:"person"`
|
||||
Date time.Time `json:"date"`
|
||||
Washed string `json:"iswashed"`
|
||||
Washed int `json:"iswashed"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user