account

Description

Account information of each customer.

Account activation is enabled/disabled by configuration.activation. Passing some days without activation, it would be better to delete the record.

Definition

Column Type Constraint Description
shop TEXT PRIMARY KEY Shop ID. (shop.username)
id INTEGER Identifier. (1-origin)
mail TEXT NOT NULL Mail address and login name. Basically, unchangeable.
password TEXT NOT NULL

Password for login.

Encrypted by String#crypt. Salt is declared by src/config.rb#CRYPTION_SALT. Of course, the salt must not be changed.

session_id TEXT UNIQUE The session_id is for checking whether the user is logged in to the account.
fname TEXT NOT NULL First name.
lname TEXT NOT NULL Last name.
fname_kana TEXT Optional. Furigana of first name. (Japanese specific)
lname_kana TEXT Optional. Furigana of last name. (Japanese specific)
lang TEXT NOT NULL Language of showing the shopping page and sending a mail. Default value is the language which a customer used when registration.
screenname TEXT Optional. Name to show for other customers (e.g. reviewer name).
birthday DATE Optional.
gender INTEGER Optional.
  • 0:female
  • 1:male
reg_date DATE NOT NULL Registered date.
activate TEXT

For account activation.

If the value is NULL, the account is already activated. Otherwise, the value is randomized string to certify the activation.

Related tables

Query

CREATE TABLE account (
shop           TEXT,
id             INTEGER,
mail           TEXT     NOT NULL,
password       TEXT     NOT NULL,
session_id     TEXT     UNIQUE,
fname          TEXT     NOT NULL,
lname          TEXT     NOT NULL,
fname_kana     TEXT,
lname_kana     TEXT,
lang           TEXT     NOT NULL,
screenname     TEXT,
birthday       DATE,
gender         INTEGER,
reg_date       DATE     NOT NULL,
activate       TEXT,
PRIMARY KEY (shop, id));