include product option pricing in the main dist
[bse.git] / schema / site_users_to_members.sql
CommitLineData
b27af108
TC
1delimiter ;;
2
3drop procedure if exists bse_update_siteusers;;
4create procedure bse_update_siteusers()
5begin
6 declare sucount integer;
7 declare cur cursor for
8 select count(*) from bse_siteusers;
9 open cur;
10 fetch cur into sucount;
11 if sucount <> 0 then
12 call error_bse_siteusers_must_be_empty;
13 end if;
257d2ab0
TC
14 insert into bse_siteusers(id, idUUID, userId, password, password_type,
15 email, whenRegistered, lastLogon, title, name1, name2, street, street2,
16 suburb, state, postcode, country, telephone, facsimile, mobile,
17 organization, confirmed, confirmSecret, waitingForConfirmation,
18 textOnlyMail, previousLogon, delivTitle, delivEmail, delivFirstName,
19 delivLastName, delivStreet, delivStreet2, delivSuburb, delivState,
20 delivPostCode, delivCountry, delivTelephone, delivFacsimile,
21 delivMobile, delivOrganization, instructions, adminNotes, disabled,
22 flags, affiliate_name, lost_today, lost_date, lost_id,
23 customText1, customText2, customText3, customStr1, customStr2,
24 customStr3, customInt1, customInt2, customWhen1)
b27af108
TC
25select
26 id,
27 uuid() as "idUUID",
28 userId,
29 password,
30 password_type,
31 email,
32 whenRegistered,
33 lastLogon,
34 title,
35 name1,
36 name2,
37 address as "street",
38 delivStreet2 as "street2",
39 city as "billSuburb",
40 state as "billState",
41 postcode,
42 country,
43 telephone,
44 facsimile,
45 delivMobile as "mobile",
46 organization,
47 confirmed,
48 confirmSecret,
49 waitingForConfirmation,
50 textOnlyMail,
51 previousLogon,
52 '' as delivTitle,
53 '' as delivEmail,
54 '' as delivFirstName,
55 '' as delivLastName,
56 '' as delivStreet,
57 '' as delivStreet2,
58 '' as delivSuburb,
59 '' as delivState,
60 '' as delivPostCode,
61 '' as delivCountry,
62 '' as delivTelephone,
63 '' as delivFacsimile,
64 '' as delivMobile,
65 '' as delivOrganization,
66 instructions,
67 adminNotes,
68 disabled,
69 flags,
70 affiliate_name,
71 lost_today,
72 lost_date,
73 lost_id,
74 customText1,
75 customText2,
76 customText3,
77 customStr1,
78 customStr2,
79 customStr3,
80 customInt1,
81 customInt2,
82 null as customWhen1
83from site_users;
84end;;
85
86delimiter ;
87
88call bse_update_siteusers;
89
90drop procedure bse_update_siteusers;