CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/util/db-schema/password-reset.ts
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { Table } from "./types";
7
8
Table({
9
name: "password_reset",
10
rules: {
11
primary_key: "id",
12
},
13
fields: {
14
id: {
15
type: "uuid",
16
},
17
email_address: {
18
type: "string",
19
},
20
expire: {
21
type: "timestamp",
22
},
23
},
24
});
25
26
Table({
27
name: "password_reset_attempts",
28
rules: {
29
primary_key: "id",
30
durability: "soft", // loss not serious, since used only for analytics and preventing attacks
31
pg_indexes: ["time"],
32
},
33
fields: {
34
id: {
35
type: "uuid",
36
},
37
email_address: {
38
type: "string",
39
},
40
ip_address: {
41
type: "string",
42
pg_type: "inet",
43
},
44
time: {
45
type: "timestamp",
46
},
47
expire: {
48
type: "timestamp",
49
},
50
},
51
});
52
53