dendrite/roomserver/storage/postgres/registration_tokens_table.go
santhoshivan23 6cd6af150b refactoring
2023-06-06 00:18:05 +05:30

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
}