what is going on
This commit is contained in:
parent
3b816f306e
commit
03fc5fd0ea
|
@ -17,6 +17,7 @@ package sqlite3
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/matrix-org/gomatrixserverlib"
|
"github.com/matrix-org/gomatrixserverlib"
|
||||||
|
@ -89,6 +90,7 @@ func NewSQLiteAccountsTable(db *sql.DB, serverName gomatrixserverlib.ServerName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
fmt.Println("TABLE CREATED")
|
||||||
m := sqlutil.NewMigrator(db)
|
m := sqlutil.NewMigrator(db)
|
||||||
m.AddMigrations([]sqlutil.Migration{
|
m.AddMigrations([]sqlutil.Migration{
|
||||||
{
|
{
|
||||||
|
@ -106,6 +108,8 @@ func NewSQLiteAccountsTable(db *sql.DB, serverName gomatrixserverlib.ServerName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
fmt.Println("MIGRATIONS RUN")
|
||||||
|
defer fmt.Println("STATEMENTS PREPARED")
|
||||||
return s, sqlutil.StatementList{
|
return s, sqlutil.StatementList{
|
||||||
{&s.insertAccountStmt, insertAccountSQL},
|
{&s.insertAccountStmt, insertAccountSQL},
|
||||||
{&s.updatePasswordStmt, updatePasswordSQL},
|
{&s.updatePasswordStmt, updatePasswordSQL},
|
||||||
|
|
|
@ -15,8 +15,6 @@
|
||||||
package sqlite3
|
package sqlite3
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"database/sql"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -43,6 +41,7 @@ func NewDatabase(base *base.BaseDendrite, dbProperties *config.DatabaseOptions,
|
||||||
Up: deltas.UpRenameTables,
|
Up: deltas.UpRenameTables,
|
||||||
Down: deltas.DownRenameTables,
|
Down: deltas.DownRenameTables,
|
||||||
})
|
})
|
||||||
|
/*
|
||||||
m.AddMigrations(sqlutil.Migration{
|
m.AddMigrations(sqlutil.Migration{
|
||||||
Version: "userapi: server names",
|
Version: "userapi: server names",
|
||||||
Up: func(ctx context.Context, txn *sql.Tx) error {
|
Up: func(ctx context.Context, txn *sql.Tx) error {
|
||||||
|
@ -50,6 +49,7 @@ func NewDatabase(base *base.BaseDendrite, dbProperties *config.DatabaseOptions,
|
||||||
},
|
},
|
||||||
Down: deltas.DownServerNames,
|
Down: deltas.DownServerNames,
|
||||||
})
|
})
|
||||||
|
*/
|
||||||
if err = m.Up(base.Context()); err != nil {
|
if err = m.Up(base.Context()); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue