15 lines
608 B
SQL
15 lines
608 B
SQL
CREATE TABLE IF NOT EXISTS member_sessions (
|
|
id UUID DEFAULT uuid_generate_v4(),
|
|
member_id UUID NOT NULL,
|
|
ip TEXT,
|
|
last_accessed_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000),
|
|
expires_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000),
|
|
created_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000),
|
|
|
|
PRIMARY KEY (id),
|
|
|
|
CONSTRAINT fk_member_sessions_member_id
|
|
FOREIGN KEY(member_id)
|
|
REFERENCES members(id)
|
|
);
|