head	1.2;
access;
symbols
	TIGRIS_1_1_0RC2:1.2
	TIGRIS_1_1_0RC1:1.2
	TIGRIS_1_1:1.2.0.4
	TIGRIS_1_0_8:1.2
	TIGRIS_1_0_8RC3:1.2
	TIGRIS_1_0_8RC2:1.2
	TIGRIS_1_0_8RC1:1.2
	TIGRIS_1_0_7:1.2
	TIGRIS_1_0_7RC3:1.2
	TIGRIS_1_0_7RC2:1.2
	TIGRIS_1_0_7RC1:1.2
	TIGRIS_1_0_6:1.2
	TIGRIS_1_0_6RC5:1.2
	TIGRIS_1_0_6RC4:1.2
	TIGRIS_1_0_6RC3:1.2
	TIGRIS_1_0_6RC2:1.2
	TIGRIS_1_0_6RC1:1.2
	TIGRIS_1_0_5:1.2
	TIGRIS_1_0_5RC6:1.2
	TIGRIS_1_0_5RC5:1.2
	TIGRIS_1_0_5RC4:1.2
	TIGRIS_1_0_5RC3:1.2
	TIGRIS_1_0_5RC2:1.2
	TIGRIS_1_0_5RC1:1.2
	TIGRIS_1_0_4:1.2
	TIGRIS_1_0_3:1.2
	TIGRIS_1_0_2:1.2
	TIGRIS_1_0_1:1.2
	TIGRIS_1_0:1.2.0.6
	TIGRIS_1_0_0:1.2
	TIGRIS_1_0_0_RC1:1.2.0.2;
locks; strict;
comment	@# @;


1.2
date	2001.03.17.22.44.02;	author edk;	state Exp;
branches;
next	1.1;

1.1
date	2001.03.17.07.50.48;	author leonardr;	state Exp;
branches;
next	;


desc
@@


1.2
log
@use the project_mlist sub_moderation, and don't insert lists which
should already be in, from the old database.
@
text
@drop table if exists xxxx_populate_MailingList;
create table xxxx_populate_MailingList (
  DOMAIN_NAME       varchar(255) NOT NULL,
  PROJECT_NAME      varchar(64) DEFAULT 'www' NOT NULL,
  LIST_NAME         varchar(64) NOT NULL,  
  TYPE              varchar(64) NOT NULL,
  IS_PRIVATE        varchar(1) default 'N' NOT NULL,
  DESCRIPTION       text
);

# sub_moderation is used for the IS_PRIVATE flag -- whether or not
# random people should be able to subscribe/see messages in the archive.
#
# most other settings are flattened, with a more limited set of possible
# values; generally we make the following assumptions:
# !message_moderation + !user_posts_only => type "unmoderated"
# message_moderation  + !user_posts_only => type "moderated"
# !message_moderation +  user_posts_only => type "discuss"
#    ** any such lists should be marked, 'cause their behavior will change
# message_moderation  +  user_posts_only => type "discuss"

insert into xxxx_populate_MailingList
(DOMAIN_NAME, PROJECT_NAME, LIST_NAME, TYPE, IS_PRIVATE, DESCRIPTION)
select
          "__DOMAIN__", project, list, "unmoderated", sub_moderation,
          "unmoderated list"
from project_mlists 
          where message_moderation="N" and user_posts_only = "N";

insert into xxxx_populate_MailingList
(DOMAIN_NAME, PROJECT_NAME, LIST_NAME, TYPE, IS_PRIVATE, DESCRIPTION)
select
          "__DOMAIN__", project, list, "moderated", sub_moderation, 
          "discussion list"
from project_mlists 
          where message_moderation="Y" and user_posts_only="N";

insert into xxxx_populate_MailingList
(DOMAIN_NAME, PROJECT_NAME, LIST_NAME, TYPE, IS_PRIVATE, DESCRIPTION)
select
          "__DOMAIN__", project, list, "discuss", sub_moderation,
          "discussion list"
from project_mlists 
          where (message_moderation="N" and user_posts_only="Y") or
                (message_moderation="Y" and user_posts_only="Y");

drop table project_mlists;

#Create new mailing lists.

##
## now insert the values into the correct table replacing
## names with ids from the corresponding tables
##
insert into HELM_MAILINGLIST 
          ( PROJECT_ID,
            LIST_NAME,
            TYPE,
            IS_PRIVATE,
            DESCRIPTION
           )
   select Project.PROJECT_ID,
          Tmp.LIST_NAME, 
          Tmp.TYPE, 
          Tmp.IS_PRIVATE, 
          Tmp.DESCRIPTION
     from xxxx_populate_MailingList as Tmp,
          HELM_DOMAIN as Domain,
          HELM_PROJECT as Project
     where Tmp.DOMAIN_NAME = Domain.NAME 
       and Domain.DOMAIN_ID = Project.DOMAIN_ID
       and Project.NAME = Tmp.PROJECT_NAME
;

drop table xxxx_populate_MailingList;

@


1.1
log
@Added scripts to convert from Tigris Classic (tm) to Tigris 1.0.0 (tm). Lovely. A few TODOs: 1) Convert project_mlists into Anzu options. 2) Figure out what to do with the domain_config table. 3) Put in the Eyebrowse tables. 4) Plug in the Bugzilla -> Issuezilla conversion script (yet to be written). That's all for today, I'm going home.
@
text
@d11 10
a20 9
#edk TODO: Move mailing lists out of project_mlists, then drop it. May
#have to do a perl script which will set settings and then drop the
#table.
insert into xxxx_populate_MailingList
(DOMAIN_NAME, PROJECT_NAME, LIST_NAME, TYPE, IS_PRIVATE, DESCRIPTION)
select
          "__DOMAIN__", project, list, "unmoderated", "Y", ""
from project_mlists 
          where message_moderation="N" and public="N";
d25 2
a26 1
          "__DOMAIN__", project, list, "unmoderated", "Y", ""
d28 1
a28 1
          where message_moderation="N" and public="Y";
d33 2
a34 1
          "__DOMAIN__", project, list, "moderated", "Y", ""
d36 1
a36 2
          where message_moderation="Y" and public="N";

d41 2
a42 1
          "__DOMAIN__", project, list, "moderated", "N", ""
d44 2
a45 1
          where message_moderation="Y" and public="Y";
a49 73

insert into xxxx_populate_MailingList
          ( DOMAIN_NAME, 
            PROJECT_NAME,
            LIST_NAME, 
            TYPE, 
            IS_PRIVATE, 
            DESCRIPTION
          )
##########################################################################
# Special projects.
  values 
         ( "__DOMAIN__",              #Domain
           "www",                     #Project Name
           "cvs",                     #List Name
           "unmoderated",             # Type
           "N",                       # IS_PRIVATE
           "cvs notification for changes to project www's content") # Desc
       , ( "__DOMAIN__",              #Domain
           "www",                     #Project Name
           "issues",                  #List Name
           "unmoderated",             # Type
           "N",                       # IS_PRIVATE
           "notification for issuezilla re: project www") # Desc
       , ( "__DOMAIN__",              #Domain
           "www",                     #Project Name
           "announce",                #List Name
           "moderated",               # Type
           "N",                       # IS_PRIVATE
           "announcements related to project www") # Desc
       , ( "__DOMAIN__",              #Domain
           "www",                     #Project Name
           "admin",                   #List Name
           "unmoderated",             # Type
           "Y",                       # IS_PRIVATE
           "admin information about this domain") # Desc
       , ( "__DOMAIN__",              #Domain
           "testproject",             #Project Name
           "cvs",                     #List Name
           "unmoderated",             # Type
           "N",                       # IS_PRIVATE
           "cvs notification for changes to project testproject") # Desc
       , ( "__DOMAIN__",              #Domain
           "testproject",             #Project Name
           "issues",                  #List Name
           "unmoderated",             # Type
           "N",                       # IS_PRIVATE
           "notification for issuezilla re: project testproject") # Desc
       , ( "__DOMAIN__",              #Domain
           "testproject",             #Project Name
           "announce",                #List Name
           "moderated",               # Type
           "N",                       # IS_PRIVATE
           "announcements related to project testproject") # Desc
       , ( "__DOMAIN__",              #Domain
           "look",                    #Project Name
           "cvs",                     #List Name
           "unmoderated",             # Type
           "N",                       # IS_PRIVATE
           "cvs notification for changes to project look") # Desc
       , ( "__DOMAIN__",              #Domain
           "look",                    #Project Name
           "issues",                  #List Name
           "unmoderated",             # Type
           "N",                       # IS_PRIVATE
           "notification for issuezilla re: project look") # Desc
       , ( "__DOMAIN__",              #Domain
           "look",                    #Project Name
           "announce",                #List Name
           "moderated",               # Type
           "N",                       # IS_PRIVATE
           "announcements related to project look") # Desc
;
@

