forked from sakaiproject/sakai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upgradeschema_mysql.config
53 lines (49 loc) · 5.13 KB
/
upgradeschema_mysql.config
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
40
41
42
43
44
45
46
47
48
49
50
51
52
# UpgradeSchema Control File (Default)
convert.0=SubmitterIdAssignmentsConversion
convert.0.handler.class=org.sakaiproject.assignment.impl.conversion.SubmitterIdAssignmentsConversionHandler
convert.0.new.columns.names=SUBMITTER_ID,SUBMIT_TIME,SUBMITTED,GRADED,KEEP
convert.0.new.columns.types=VARCHAR(99),VARCHAR(99),VARCHAR(6),VARCHAR(6),VARCHAR(1)
convert.0.new.columns.qualifiers=default null,default null,default null,default null,default 'X'
convert.0.new.columns.add=alter table ASSIGNMENT_SUBMISSION add <name> <type> <qualifier>
convert.0.new.columns.test=show columns from ASSIGNMENT_SUBMISSION like '<name>'
convert.0.create.migrate.table=create table assn_submit_fsregister ( id varchar(1024), status varchar(99), index assn_submit_fsregister_id_idx (id(10)), index assn_submit_fsregister_status_idx (status(10)) )
convert.0.drop.migrate.table=drop table assn_submit_fsregister
convert.0.check.migrate.table=select count(*) from assn_submit_fsregister where status <> 'done'
convert.0.select.next.batch=select id from assn_submit_fsregister where status = 'pending' limit 100
convert.0.complete.next.batch=update assn_submit_fsregister set status = 'done' where id = ?
convert.0.mark.next.batch=update assn_submit_fsregister set status = 'locked' where id = ?
convert.0.populate.migrate.table=insert into assn_submit_fsregister (id,status) select SUBMISSION_ID, 'pending' from ASSIGNMENT_SUBMISSION
convert.0.select.record=select XML from ASSIGNMENT_SUBMISSION where SUBMISSION_ID = ?
convert.0.select.validate.record=select XML from ASSIGNMENT_SUBMISSION where SUBMISSION_ID = ?
convert.0.update.record=update ASSIGNMENT_SUBMISSION set SUBMITTER_ID = ?, SUBMIT_TIME = ?, SUBMITTED = ?, GRADED = ? where SUBMISSION_ID = ?
convert.1=DuplicateSubmissionAssignmentsConversion
convert.1.handler.class=org.sakaiproject.assignment.impl.conversion.CombineDuplicateSubmissionsConversionHandler
convert.1.create.migrate.table=create table assn_dupes_fsregister (id VARCHAR(99), STATUS VARCHAR(99), index assn_dupes_fsregister_id_idx (id), index assn_dupes_fsregister_status_idx (status))
convert.1.drop.migrate.table=drop table assn_dupes_fsregister
convert.1.check.migrate.table=select count(*) from assn_dupes_fsregister where status <> 'done'
convert.1.select.next.batch=select id from assn_dupes_fsregister where status = 'pending' limit 100
convert.1.complete.next.batch=update assn_dupes_fsregister set status = 'done' where id = ?
convert.1.mark.next.batch=update assn_dupes_fsregister set status = 'locked' where id = ?
convert.1.populate.migrate.table=insert into assn_dupes_fsregister (id,status) select SUBMISSION_ID,'pending' from ASSIGNMENT_SUBMISSION group by CONTEXT,SUBMITTER_ID HAVING count(SUBMISSION_ID) > 1
convert.1.select.record=select XML from ASSIGNMENT_SUBMISSION where (CONTEXT, SUBMITTER_ID) = (select CONTEXT, SUBMITTER_ID from ASSIGNMENT_SUBMISSION where SUBMISSION_ID = ?)
convert.1.select.validate.record=select XML from ASSIGNMENT_SUBMISSION where SUBMISSION_ID = ?
convert.1.update.record=update ASSIGNMENT_SUBMISSION set XML = ?, SUBMIT_TIME = ?, SUBMITTED = ?, GRADED = ?, KEEP = 'T' where SUBMISSION_ID = ?
convert.2=RemoveDuplicateSubmissionAssignmentsConversion
convert.2.handler.class=org.sakaiproject.assignment.impl.conversion.RemoveDuplicateSubmissionsConversionHandler
convert.2.create.migrate.table=create table assn_dupes_fsregister (id VARCHAR(99), STATUS VARCHAR(99), index assn_dupes_fsregister_id_idx (id), index assn_dupes_fsregister_status_idx (status))
convert.2.drop.migrate.table.count=7
convert.2.drop.migrate.table.0=drop table assn_dupes_fsregister
convert.2.drop.migrate.table.1=CREATE UNIQUE INDEX ASSIGNMENT_SUBMISSION_SUBMITTER_INDEX ON ASSIGNMENT_SUBMISSION(CONTEXT,SUBMITTER_ID)
convert.2.drop.migrate.table.2=alter table ASSIGNMENT_SUBMISSION drop column keep
convert.2.drop.migrate.table.3=DELETE FROM ASSIGNMENT_SUBMISSION WHERE CONTEXT IS NULL
convert.2.drop.migrate.table.4=DELETE FROM ASSIGNMENT_SUBMISSION WHERE SUBMITTER_ID IS NULL
convert.2.drop.migrate.table.5=ALTER TABLE ASSIGNMENT_SUBMISSION MODIFY CONTEXT VARCHAR(99) NOT NULL
convert.2.drop.migrate.table.6=ALTER TABLE ASSIGNMENT_SUBMISSION MODIFY SUBMITTER_ID VARCHAR(99) NOT NULL
convert.2.check.migrate.table=select count(*) from assn_dupes_fsregister where status <> 'done'
convert.2.select.next.batch=select id from assn_dupes_fsregister where status = 'pending' limit 100
convert.2.complete.next.batch=update assn_dupes_fsregister set status = 'done' where id = ?
convert.2.mark.next.batch=update assn_dupes_fsregister set status = 'locked' where id = ?
convert.2.populate.migrate.table=insert into assn_dupes_fsregister (id,status) select sub1.SUBMISSION_ID,'pending' from ASSIGNMENT_SUBMISSION sub1 inner join (select CONTEXT,SUBMITTER_ID from ASSIGNMENT_SUBMISSION group by CONTEXT,SUBMITTER_ID HAVING count(*) > 1) sub2 on sub1.context = sub2.context and sub1.submitter_id = sub2.submitter_id and sub1.keep <> 'T'
convert.2.select.record=select SUBMISSION_ID from ASSIGNMENT_SUBMISSION where SUBMISSION_ID = ?
convert.2.select.validate.record=select SUBMISSION_ID from ASSIGNMENT_SUBMISSION where SUBMISSION_ID = ?
convert.2.update.record=delete from ASSIGNMENT_SUBMISSION where SUBMISSION_ID = ?