aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/Resources/AuthStore.migrations
blob: 9450940e038e00847cdc46afdc54694f4f85c2ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
:VERSION 1         # -------------------------------

begin;

CREATE TABLE `auth` (
  `UUID` char(36) NOT NULL,
  `passwordHash` char(32) NOT NULL default '',
  `passwordSalt` char(32) NOT NULL default '',
  `webLoginKey` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`UUID`)
) ENGINE=MyISAM;

CREATE TABLE `tokens` (
  `UUID` char(36) NOT NULL,
  `token` varchar(255) NOT NULL,
  `validity` datetime NOT NULL,
  UNIQUE KEY `uuid_token` (`UUID`,`token`),
  KEY `UUID` (`UUID`),
  KEY `token` (`token`),
  KEY `validity` (`validity`)
) ENGINE=MyISAM;

commit;

:VERSION 2         # -------------------------------

BEGIN;

INSERT INTO auth (UUID, passwordHash, passwordSalt, webLoginKey) SELECT `UUID` AS UUID, `passwordHash` AS passwordHash, `passwordSalt` AS passwordSalt, `webLoginKey` AS webLoginKey FROM users;

COMMIT;

:VERSION 3         # -------------------------------

BEGIN;

ALTER TABLE `auth` ADD COLUMN `accountType` VARCHAR(32) NOT NULL DEFAULT 'UserAccount';

COMMIT;