Clean up some logging
This commit is contained in:
parent
03fc5fd0ea
commit
2e74be1bf2
|
@ -15,8 +15,6 @@
|
|||
package postgres
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
|
@ -45,13 +43,15 @@ func NewDatabase(base *base.BaseDendrite, dbProperties *config.DatabaseOptions,
|
|||
Up: deltas.UpRenameTables,
|
||||
Down: deltas.DownRenameTables,
|
||||
})
|
||||
m.AddMigrations(sqlutil.Migration{
|
||||
Version: "userapi: server names",
|
||||
Up: func(ctx context.Context, txn *sql.Tx) error {
|
||||
return deltas.UpServerNames(ctx, txn, serverName)
|
||||
},
|
||||
Down: deltas.DownServerNames,
|
||||
})
|
||||
/*
|
||||
m.AddMigrations(sqlutil.Migration{
|
||||
Version: "userapi: server names",
|
||||
Up: func(ctx context.Context, txn *sql.Tx) error {
|
||||
return deltas.UpServerNames(ctx, txn, serverName)
|
||||
},
|
||||
Down: deltas.DownServerNames,
|
||||
})
|
||||
*/
|
||||
if err = m.Up(base.Context()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ package sqlite3
|
|||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
|
@ -90,7 +89,6 @@ func NewSQLiteAccountsTable(db *sql.DB, serverName gomatrixserverlib.ServerName)
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
fmt.Println("TABLE CREATED")
|
||||
m := sqlutil.NewMigrator(db)
|
||||
m.AddMigrations([]sqlutil.Migration{
|
||||
{
|
||||
|
@ -108,8 +106,6 @@ func NewSQLiteAccountsTable(db *sql.DB, serverName gomatrixserverlib.ServerName)
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
fmt.Println("MIGRATIONS RUN")
|
||||
defer fmt.Println("STATEMENTS PREPARED")
|
||||
return s, sqlutil.StatementList{
|
||||
{&s.insertAccountStmt, insertAccountSQL},
|
||||
{&s.updatePasswordStmt, updatePasswordSQL},
|
||||
|
|
|
@ -33,10 +33,7 @@ func UpServerNames(ctx context.Context, tx *sql.Tx, serverName gomatrixserverlib
|
|||
)
|
||||
var c int
|
||||
if err := tx.QueryRowContext(ctx, q).Scan(&c); err != nil || c == 0 {
|
||||
fmt.Println("Error:", err)
|
||||
continue
|
||||
} else {
|
||||
fmt.Println("HAPPY DAYS!", table)
|
||||
}
|
||||
q = fmt.Sprintf(
|
||||
"ALTER TABLE %s ADD COLUMN IF NOT EXISTS server_name TEXT NOT NULL DEFAULT '';",
|
||||
|
|
Loading…
Reference in a new issue