Revert non-trivial schema changes and move them to a new schema version.

This commit is contained in:
Erik Johnston 2015-04-10 10:05:44 +01:00
parent 2ded344620
commit a1665c5094
19 changed files with 636 additions and 27 deletions

View file

@ -13,6 +13,7 @@
* limitations under the License.
*/
CREATE TABLE IF NOT EXISTS users(
id BIGINT PRIMARY KEY AUTOINCREMENT,
name VARCHAR(150),
password_hash VARCHAR(150),
creation_ts BIGINT,
@ -35,8 +36,8 @@ CREATE TABLE IF NOT EXISTS user_ips (
device_id VARCHAR(150),
ip VARCHAR(150) NOT NULL,
user_agent VARCHAR(150) NOT NULL,
last_seen BIGINT NOT NULL
last_seen BIGINT NOT NULL,
UNIQUE (user, access_token, ip, user_agent)
);
CREATE INDEX IF NOT EXISTS user_ips_user ON user_ips(user);
CREATE INDEX IF NOT EXISTS user_ips_user_ip ON user_ips(user, access_token, ip);