mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-13 17:13:10 -06:00
26 lines
488 B
Go
26 lines
488 B
Go
package postgres
|
|
|
|
import (
|
|
"context"
|
|
"database/sql"
|
|
)
|
|
|
|
const registrationTokensSchema = `
|
|
CREATE TABLE IF NOT EXISTS roomserver_registration_tokens (
|
|
token TEXT PRIMARY KEY,
|
|
pending BIGINT,
|
|
completed BIGINT,
|
|
uses_allowed BIGINT,
|
|
expiry_time BIGINT
|
|
);
|
|
`
|
|
|
|
func CreateRegistrationTokensTable(db *sql.DB) error {
|
|
_, err := db.Exec(registrationTokensSchema)
|
|
return err
|
|
}
|
|
|
|
func RegistrationTokenExists(ctx context.Context, tx *sql.Tx, token string) (bool, error) {
|
|
return true, nil
|
|
}
|