Update Core.
[platal.git] / upgrade / 0.9.2 / 99_virtual.sql
CommitLineData
0337d704 1--------------------------------------------------------------------------------
2-- alters
3--------------------------------------------------------------------------------
4alter table virtual change column vid vid int not null auto_increment;
5alter table virtual change column alias alias varchar(255) not null;
6alter table virtual change column type type enum('user','list','dom') not null default 'user';
7alter table virtual add unique (alias) ;
8alter table virtual_redirect change column vid vid int not null auto_increment;
9alter table virtual_redirect add index (redirect);
10
11--------------------------------------------------------------------------------
12-- copies melix.net
13--------------------------------------------------------------------------------
14insert into virtual
15 select null,domain,'user'
16 from groupex.aliases
17 where domain like '%@melix.net';
18
19insert into virtual_redirect
20 select vid,CONCAT(email,'@m4x.org')
21 from virtual AS v
22 inner join groupex.aliases as d ON(v.alias=d.domain);
23
24delete from groupex.aliases where domain like '%@melix.net';
25
26--------------------------------------------------------------------------------
27-- establish @melix.org -> @melix.net
28--------------------------------------------------------------------------------
29insert into virtual (alias,type) VALUES('@melix.org','dom');
30insert into virtual_redirect
31 select vid,'@melix.net'
32 from virtual
33 where alias='@melix.org';
34
35delete from groupex.aliases where domain = '@melix.org';
36